MAS course practice

Arithmetic System

Tandil, Argentina, nov. 1999

Professor: Yves Damazeu
Student: Adrián Allende

Contents

The problem

Design/Model

Implementation

Notes

The problem (arithmetic system)

- Ramdomly generated X individuals having each the knowledge of a given number of operators.
- Global set of possible operators: +, -, *, /, exp, ln.
- A mathematical formula (including parenthesis) is ramdomly given to one individual that has to compute the result and to deliver it to the user.
- (Options) learning other's skills, optimizing interactions between individuals.

Design/Model

In brief, the problem is descomposed to fit in a MAS this way: the formula (F) is the 'environment'. The agents representing the individuals (Ind) walks throw the F and solve the part he/she can, putting the result in order that the other's can collect and use.

(E) The formula as environment

Let's F represented by the usual parse tree, then the Ind waks throw F following the edges, and visit the nodes to see if there is a operation he/she can solve. The nodes then, appart for the operation and sub-trees info, must have a place to deposit the evaluation of this sub-tree made for Ind.

(A) Individuals and other agents

First, the individuals are descomposed in the individual itself (Ind), and the operators-agents (Op). The Ind traverses F (the environment) and interact with other Inds, while the Ops only solves the node Ind give to it. This descomposition is a desing desision due to the (future, optional) need to exchange 'knowledge' (skills, abilities?) between individuals. This way, an individual in the problem's description is represented by an Ind and a set of Ops. I'm not sure about Op is an agent, may be only an OOP object owned (referenced) by Ind, but there is a need in communicate Ind and his Ops and then I think Op is an agent [recursion note].

May be useful to implement a "launcher" agent in order to create and lauch the randomly stuff.

OP behavior

It's very simple, only respond to Ind request of solving puting the result on the given node of F.

Ind behavior

I can not think in Ind behavior without think in Interaction, so, it's not independent. Trying to not communicate the Inds with a formal protocol, ontology, and bla bla, may be possible put the interaction only in the E. I put the explicit aproache here. The implicit (throw E) communication aproach is more direct to implement, waiting for a F to appear and waiting for a result in F's root node.

Main
respond to formula solve request
take into acout of partners solvers Ind
parse the formula and put the tree (F) available
send a "formula arrived" msg to all
do my job on solving
wait until collect all "ready" msgs
respond to "formula arrived" request
solving behavior
Solving
taking into acount of skills asigned in this reencarnation
Walk throw F, make a list of nodes (my_nodes) I can solve
Walk (only) throw my_nodes until my_nodes = {}
if node marked, 
then somebody has solved it or is solving, so delete from my_nodes.
else if subtrees are solved I can solve, so Solve
next node
Solve
Mark to prevent another Ind solve this node
Send a msg to the appropiate OP
Delete node from my_nodes

See [split Ind note] [another marking aproach]

 

Implementation

nothing yet.

Notes

[recursion note]

May be a recursion there?. The whole MAS (MAS1) is F as E and Ind as A, while each Ind is a MAS (MAS2) where a node in F is the E and Ind and his OPs is each A. Note MAS1 resembles pure collecting-robot like while MAS2 need more 'direct' (no throw E) communication.

[split Ind note]

The Inds have 2 well defined distinct behaviors, named "Main" and "solving". I think in spliting the Ind in 2 agents, where for "Main" only 1 agent exist in the system. This is true: the 'Main' behavior is activated only 1 time in 1 Ind agent. But this do not match the spirit of the problem. Is this a kind of centralization?. It's more mantenible, think in reinstall agents.

[another marking aproach]

With some distance concept or putting an emphasis on node rearching, may be useful to think in mark the nodes first and then claim for neccessary operators.