public class Main {
public static void main(String[] args)
{
SREBootstrap bootstrap = SRE.getBootstrap();
try {
bootstrap.startAgent(Interface.class);
/* start an agent with parametres sned value="Up" */
bootstrap.startAgent(CarAgent.class,"Up");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
agent CarAgent
{
uses CarCapacity, Schedules
//______ my position ____
on Initialize
{
// how can i get this params ="Up"
setSkill(new CarsSkills)
createbody(posX, posY, "Up")
every(50)
[
posY =posY+2
move(posX, posY, "Up")
]
}
on Destroy
{
}
}
agent CarAgent {
uses CarCapacity, Schedules
//______ my position ____
on Initialize {
// how can i get this params ="Up"
val param = occurrence.parameters.get(0) as String
setSkill(new CarsSkills)
createbody(posX, posY, param)
every(50) [
posY =posY+2
move(posX, posY, param)
]
}
on Destroy {
}
}