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
The following code highlight an error (Assignment to final field) :
agent TransmitterAgent {
val capacityValue : Double
on Initialize {
capacityValue = occurrence.parameters.get(0) as Double;
}
}
Moreover an error occurs in the java code.
public class TransmitterAgent extends Agent {
/**
* Creates a new Agent of type TransmitterAgent
*/
public TransmitterAgent(final java.util.UUID parentID) { // error
// Multiple markers at this line
// - The blank final field capacityValue may not have been initialized
The text was updated successfully, but these errors were encountered:
val capacityValue : Double = 5 this is the only way to initialize a val inside an agent. Because val keyword is mapped to a final attribute in Java, and the Agent's constructor is not accessible to the user.
The various "on initialize" must be the constructors of the agent but currently there is no easy solution to do that.
The following code highlight an error (Assignment to final field) :
Moreover an error occurs in the java code.
The text was updated successfully, but these errors were encountered: