You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create an agent with the following code, I obtain a compilation error.
event Titi {
}
agent HelloAgent {
uses Lifecycle, Schedules, DefaultContextInteractions
on Initialize {
System.out.println("Hello World!") emit(new Titi)
}
on Titi {
spawn(HelloAgent, #[])
HelloAgent.spawn(#[])
spawn(HelloAgent)
HelloAgent.spawn()
}
/* Print "Goodbye World" before dying */
on Destroy {
System.out.println("Goodbye World!")
}
}
The two first lines with the "spawn" statements are correctly compiled.
The third line with the "spawn" statement gives the error:
Multiple markers at this line
- Type mismatch: cannot convert implicit first argument from
HelloAgent to Class<? extends Agent>
- Type mismatch: cannot convert from Class<HelloAgent> to Object[]
The fourth line with the "spawn" statement gives the error:
Invalid number of arguments. The method spawn(Class<? extends
Agent>, Object[]) is not applicable for the arguments (Class<HelloAgent>)
The text was updated successfully, but these errors were encountered:
When trying to create an agent with the following code, I obtain a compilation error.
The two first lines with the "spawn" statements are correctly compiled.
The third line with the "spawn" statement gives the error:
The fourth line with the "spawn" statement gives the error:
The text was updated successfully, but these errors were encountered: