LightJason / Java-AgentSpeak

LightJason - AgentSpeak(L++) for Java
https://agentspeak-java.lightjason.org
Other
23 stars 7 forks source link

Add shortcut methods for triggers #60

Closed michalsustr closed 6 years ago

michalsustr commented 6 years ago

I see a lot of examples have code like

this.trigger( CTrigger.from( ITrigger.EType.ADDGOAL, CLiteral.from( "vehicle/collision" ) ) );

Can it be simplified to something like

this.addGoal("vehicle/collision");

(eg add new method to IBaseAgent)

flashpixx commented 6 years ago

With your proposal I'm mixing agent execution with trigger data, because I must implement for each enum typ in EType a method, so if I extend the enum, I must also extend the agent methods. That is not possible, but I think I can add a method build( ILiteral p_literal ) to the enum type, so that the CTrigger.from can be removed

flashpixx commented 6 years ago

fixed for the next release