Re: initializing MAS with no agents

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: initializing MAS with no agents

Jomi Hubner
Hi Andrew,

You need to create the environment, call its init, create the agents, set the env. class for the agents, and then start the agents' thread.

See the class jason.infra.centralised.RunCentralisedMAS for an example .

Cheers,

Jomi

On 29/07/2011, at 12:15, Andrew Koster wrote:

> In fact, I have a follow-up question: what is the correct way of
> ensuring the environment has started before creating the agents from
> java? If I add the "createAgent" calls to the init method of the
> environment the runtime is not completely initialized and I get errors
> in the reasoningCycle (even if I leave the beliefs, goals and plans
> empty at the start and don't add any percepts in the environment).
>
> My current workaround is to change the "none" agent I mentioned in my
> previous email into an agent which creates all the agents for the
> environment (using a custom action in java) and then kills itself. This
> does not seem like a particularly neat solution.
>
> Cheers,
> Andrew
>
> Andrew Koster escribió:
>> Hi,
>>
>> I need to create my agents from Java using the createAgent method
>> because the number (and types) of agents are specified in a separate
>> config file. However the parser dislikes my mas2j file if I do not have
>> at least one agent. I have created "none.asl" as an empty file and have
>> the corresponding "none" agent in my mas2j, which is an effective
>> workaround, but it seems strange that the parser does not allow a file
>> with 0 agents. Is there some way to do this?
>>
>> Cheers,
>> Andrew
>>
>> ------------------------------------------------------------------------------
>> Got Input?   Slashdot Needs You.
>> Take our quick survey online.  Come on, we don't ask for help often.
>> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
>> http://p.sf.net/sfu/slashdot-survey
>> _______________________________________________
>> Jason-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jason-users
>>
>
>
> ------------------------------------------------------------------------------
> Got Input?   Slashdot Needs You.
> Take our quick survey online.  Come on, we don't ask for help often.
> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> http://p.sf.net/sfu/slashdot-survey
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Loading...