• No se han encontrado resultados

El surf com a eina d’intervenció socioeducativa

DISCUSSIÓ DeLS ReSULTATS

5. ANÀLISI I DISCUSSIÓ DE RESULTATS

5.4. El surf com a eina d’intervenció socioeducativa

Cases in the agent are implemented in a frame-like data structure where each frame represents a complete case. It was decided to represent one case per frame for simplicity rather than a distributed structure. Each case is implemented as a Prolog clause with two fields. The first field holds a unique name for the case, the second holds a nested hierarchy of attribute-value pairs that define symptoms and a solution for the case (see figure 8.5). Each case situation is described by four attributes that contain lists of clauses; they are the initial description, the solution, the final state and the success of the case.

case( upperCaseKeyword, [

initial - [errortype(compiletime), start(P),

keywordCase(P)],

solution - [Opt = ["The " + P + " should be all lower case",

"Python is case sensitive so " + P + " should be lower case", "Check the case of your " + P + " keyword"],

bdi:selectOne(Opt,I2), avatar:speak(I2),

bdi:rememberCase(upperCaseKeyword,I2)], final - [checkResult([lower(P),_])],

success - true]).

Table 8.2. Table of addressable agent subsystems

130

The initial attribute contains clauses that identify the nature of the error, for most cases the information about the error messages produced by the Python development environment. This strategy allows MRCHIPS to be guided by the context of what the learner is working on and avoids the risk of providing information on unrelated problems that might only have the effect of confusing the learner. The solution attribute lists the set of actions the agent is to carry out to achieve the state of the final attribute. The success attribute indicates the desirability of the outcome. Both solution and final attributes are not currently used by MRCHIPS but included for future expansion. The agent’s case-base contains records of typical novice level errors based on information gathered from observations from cohorts of learners explained in the literature and analysed in chapter six. Although the errors observed were as a result of different types of coding problems the ultimate action of the agent is the same in each case, to provide additional information – the difference occurs in meaning of the information provided.

The cases in MRCHIPS are indexed and stored using a discrimination tree (Charniak et al. 1987), also called a discrimination network, which Figure 8.6. Fragment of a discrimination tree as a case-base index

begin compileTime runTime logicTime statement(if) nameError typeError noOutput concatenation Error statement(while) compileTime, statement(while) compileTime, statement(if) .

runTime, typeError, concatenation.

runTime, nameError.

131

provides an efficient method to access the case-base. A discrimination tree is a branching network data structure used for storing and retrieving large numbers of symbolic objects. The principle behind a discrimination tree is to recursively partition a set of objects where each partition divides the set based on a particular property and properties that are similar by some measure are shared in memory. The effect of placing data in the network is to cluster together items that are similar. As a side effect of the clustering a discrimination network is also able to discriminate between cases. For instance as illustrated in figure 8.6, MRCHIPS cases are initially partitioned based on the class of error, so some cases belong to the set of compile-time errors, others to the run- time errors and others to a third set of the logical-errors. Each internal node is a question that subdivides the items of data that are stored below, where each item is a different answer to the question. Case retrieval is performed by using the features of the problem case as a map into the discrimination tree to similar cases and a complete case is stored at the terminal node of each branch of the tree. The algorithm for searching a discrimination network is based on a simple loop shown below. The main work of the search is contained in the strategy for matching nodes.

Let N = top node of tree Repeat until N is a case:

Ask question at N of the input

Let N = subnode with the answer that best matches the input Return N

Incomplete data, indicated by a non-ground expression returns all of the sub-cases of a branch. If a variable is encountered in the problem case during retrieval it is matched against the corresponding field in the discrimination tree and all of the branches of the tree below that may have a valid value for the variable remain in the search. Ground value, occurring later in the problem case can be used to discriminate the branches at a later iteration of the retrieval. If the variable is in the tree

132

it can be matched against any corresponding fields in the case and the search continued. A measure is kept of the degree of match for each clause selected from the discrimination tree and the solutions returned in a sorted list if more than one exists. The degree of match is given by the expression:

D = 3 * NE + NV

Documento similar