The problem
Installation
Usage
Results analysis
Developing
To see design and model detail, follow this link.
Create a "MAS" directory in "<madkit root>\src" (eg.: C:\madkit1.3.2\src\MAS).
Decompress the zip in the previously created "MAS" directory.
Copy <madkit root>\src\MAS\practice.jar to <madkit root>\autoload\
Copy <madkit root>\src\MAS\practice\Exp.jar to <madkit root>\
Copy <madkit root>\src\MAS\r.bat to <madkit root>\
"Formula (takes precedence if random != 0): "
This is a formula to solve (eg.: 1 + 1) . The sintax
is the usual, with exp( ) and log() operations as usual. Be careful in
not to put a minus operator without a space, cause the java.StreamTokenizer
takes the minus as the sign of the number (ie.: not as the operator) (eg.:
1-2 is not parsed as usual, is parsed as [number = 1] and [number = -2]
without a operator, of course, an error. To avoid this, simply put a space
between - and 2.).
If this parameter is not blank, the following parameter
is ignored.
"Random formula operators quantity = Random 1 to: "
Ignored if parameter above is not blank.
A random formula will be crated with the specified
operators. The constants are random [0..100].
"Individual Agents quantity = Random 1 to: "
The launcher launch as many 'math skilled individual' (Ind) agents as [Random * this_parameter + 1].
"Per Individual Agents skills quantity = Random 1 to (max 7): "
The Ind agents assigns itself as many skills in operation
evaluation as [Random * this_parameter + 1].
If after the assignment nobody has an operator skill,
the launcher puts all the unasigned skills in the first (named "Ind[0]")
Ind, to avoid an infinite execution.
"Verbose level (0 or 1): "
The Ind agents can be VERY verbose in inform the formula traverses with 1, but is sufficient with 0. The last words of each Ind is the only useful (except to develop and test).
Now, you can use the "Result!-->" button, after execution an Ind
puts the result in the edit at right.
Be pacient! may be several minutes without feddback, but the
system works fine!.
Not be surprised for a NaN (not a number) result, is not an error. Very
often a 100 operators random formula involves a log() of a number <
0.
The formula to solve.
The skills he has.
The total team of Inds.
(When the Ind traversed the formula first time, remembers the nodes
of his interest)
The total number of nodes he can solve.
(When the Ind traverses his nodes list)
The total number of nodes he encounters solved.
The total number of nodes he encounters marked for another Ind
solving this node.
The total number of nodes he encounters still unevaluabled (cause
sub-tree(s) are unevaluated).
The total number of his nodes he traverses in the cycle.
The guy that solves the root of the formula, shows the result too.
This implies that :
Showing the result for the launcher is done only for comodity of usage,
and is made with comunication. If you want to be "purist" and not to use
explicit communication (not needed in this aproach) you can comment all
the communication stuff (well marked with comments in the Ind and Launcher
classes), recompile and show the results in the Ind[i] that evaluated the
root.
The <madkit root>\src\MAS\practice\Exp\ contains the Expression classes
that models the formula.
If change something there, you nedd to
<madkit root>\src\MAS\practice\Exp > javac *.java
<madkit root>\src\MAS\practice > jar cf Exp.jar Exp/*.class
<madkit root>\src\MAS\practice > copy Exp.jar ..\..\.. [to madkit root](see jarExp.bat)
The <madkit root>\src\MAS\practice\ contains the Ind, Launch and
LaunchBean classes that models the individuals.
If change something there, you nedd to
<madkit root>\src\MAS\practice > javac *.java
<madkit root>\src\MAS > jar cfm practice.jar Manifest.txt practice/*.class (see <madkit root>\src\MAS\manifest.txt)
<madkit root>\src\MAS > copy *.jar ..\..\autoload [to <madkit root>\autoload](see <madkit root>\src\MAS\practice\j.bat)
The guy that solves the root of the formula, shows the result too. Showing
the result for the launcher is done only for comodity of usage, and is
made with comunication. If you want to be "purist" and not to use explicit
communication (not needed in this aproach) you can comment all the communication
stuff (well marked with comments in the Ind and Launcher classes), recompile
and see the results in the Ind[i] that evaluated the root at usage time.