• No se han encontrado resultados

CAPÍTULO III. EL CASO DE LA PROVINCIA DE SANTA FE: LA ESTRATEGIA

4. El nivel operativo de la coordinación del Plan ABRE Aspectos de la

4.1. Equipos territoriales interministeriales: “enredar” el barrio

Figure 6.6 outlines the stages of the process used to generate an explanation Appendix D gives more detail about the objects involved in this process, together with details of the diagramming convention used below.

Fire Rules Ask cost justification questions Recommend a piece of Equipment Explanation of all current Plant Layout alteration options Figure 6.6

6.2.1 Firing the Knowledge Base

To analyse the plant the user presses the button 'Diagnose' and selects 'FireRules' on the main Session window called 'User Interface'. This function which fulfils the following task

^napter e> - r .J L .u .i. l^ eveiop m en i • Clears the fact base. Kappa-Pc structures rules and facts by associating

them with slots inside a object. This means that slots used internally during inferencing need to be reset each time the knowledge base fires. To write the system so that it only clears the slots used internally would make the system difficult to maintain and will increase the complexity of the use of rules. To reset only the internal facts requires the system to know what fact have just been used internally, which is difficult. For this reason the fact base is totally reset each time the knowledge base is fired. This means that initial values have to be added to the fact base and asserted before each knowledge base firing ( see Figure 6.7 ). The slots used to represent the fact base are written in objects and instances which are part of the PlantEquipment class. Not all of the slots in this class are used in the fact base. These slots are not reset with each inferencing.

new facts determ ined via rules

initial facts current facts m atched to rules new facts created whilst inferencing

initial a s s e r ti o n ^ current assertio n s

Fact Base Inference Engine Link to Plant Information Working memory of asserted facts Figure 6.7

• RunRuleLists instance is initialised. This instance is used to generate explanations, discussed in section 6.2.5.

• The value of equipment selected is updated in the 'User Interface' window.

^napter t> - r .L .u .r . d e v e lo p m e n t • A message is sent to the object RunRulesLink to fire the method

'Assert'. This provides the link to plant information.

• The explanation system generates an explanation from the results of the rules fired. This is done by sending a message to RunRuleLists to fire the method 'Explain'.

6.2.2 Integration of the rules

Each time the rule base is fired it is necessary to update the slots used in the rules which are contained in the PlantEquipment class. Slots in this class act as a factbase, these are asserted along with slots contained in the 'AssertedRulesLink' class. The slots in the 'AssertedRulesLink' class are stored in a list called 'SelfAssertList'. The instance 'RunRulesLink' controls this process. The other instances in the 'AssertedRulesLink' class exist to store the inputs to rules which require the users' input.

The reason for the use of forward chaining is so that the system identifies all possible alterations and then recommends the equipment which offers the best return on the money invested. If backward chaining were used then the system would only identify one possible solution. For the system to specify a solution it might have to compare more than one possible equipment option, but is unlikely to identify them all.

Because the user of the system controls the specification of what equipment to add to the mill, it is better for the system to inform them of all possible solutions.

cn a p ter b - r .L .u .r . u e v e io p m e n t Some of the user inputs to the factbase do not come directly from the interface, these are rules associated with checking money and time requirements. The last action of the method 'Assert' is to send a message to each piece of equipment in the PlantEquipment class asking them to check their cost and time links.

For each piece of equipment which can be added to the mill, represented as an object in PlantEquipment class, there exist two slots which enable / disable the use of cost or time links. These are altered by the user with the 'Equipment' menu on the main interface window ( see figure 6.3 ). This m enu allows the user to select the equipment and then choose to enable / disable the cost and / or time links, using a check box. Information about the various costs and times from the piece of equipment then need to be entered. If values are not entered then the system informs the user and disables the appropriate link.

The values for costs / times ( details which can be modified by the user ) used in the links are stored at the equipment level. These are then compared with the values of total money / time allowed for the layout alteration. This is done with the use of methods which either set the value of the 'MoneyAvailable' / 'TimeAvailable' slot to Excessive or NotExcessive.

6.2.3 Creating Explanations

Explanations can be generated in other systems using the text of the rules, e.g. Xi Plus. Explaining the reasons for a choice using the rules, makes

cn a p ter b - r .L .u .r . u e v e io p m e n t the explanations harder to understand. With Xi Plus the system uses the rules to explain Why a question is being asked. Because Xi Plus can be written using English type rules this makes it relatively easy for the user to follow why a question is being asked.

The Kappa-Pc inference browser provides a clear diagrammatic explanation of how the rules have fired. As the volume of rules fired increases it becomes more difficult to determine which pieces of knowledge are important in the present situation. Kappa-Pc requires a name for each rule. These are used in the inference browser to inform the user which rules have been fired. The browser can be used to access the rules themselves. These however have to be written using objects and slots which make the rules confusing to a lay person. Figure 6.8 shows the a typical window used for editing a rule.

Rule tracing is provided as part of the system, and is controlled by the system. This does not allow the programmer the scope to control the use of the explanations. Because of this it was necessary to create a custom explanation system, which uses the rules comment text.