Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340846 - Creating Agents during run time
Summary: Creating Agents during run time
Status: NEW
Alias: None
Product: AMP
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 08:29 EDT by lukschmi CLA
Modified: 2011-03-26 17:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lukschmi CLA 2011-03-24 08:29:01 EDT
Build Identifier: 

If any new agents are being created (i.e. from the global model by an action and a rule) during run time the new agents are build however they do not perform any initialize action according their agent class.

Reproducible: Always
Comment 1 Miles Parker CLA 2011-03-24 13:39:53 EDT
This is actually something that I've thought a bit about and I'm not sure what option to take. Form one point of view it make senses to always call the initialize method for newly created agents. On the other hand when agents are created during a run is that "really" initialization? For example, we often set agents at random locations at the start of a run and that typically wouldn't be something e would want to do late in a run. If we call initialize automatically, there would be no way to prevent that from happening. On the other hand, you can always call initialize directly using the "Perform" action.

ANother option would be to have a flag for create agents which indicates whether the agents should be initialized as well.
Comment 2 lukschmi CLA 2011-03-25 02:21:10 EDT
I see the point, where you do not want to have the new agents be initialized. However in many cases an initialization is desired. The workaround we did was using an additional method calling the initialization:

List<Rule> rules = new ArrayList<Rule>();
			for(Object obi : getPatientScape().getInitialRules().getVector()){
				rules.add((Rule)obi);

But this is not very intuitive. I like your idea with the flag, where I can specify in the properties if the new agents should be initialized or not. Such feature would help a lot.
Comment 3 Miles Parker CLA 2011-03-26 17:26:42 EDT
Before deciding to do it that way, what about adding an "Initialize" Action to the set of actions which would call all agent initialize actions, or explicitly calling the separate Initialize actions?  I mention that because when we create better support for grouped actions it may be that the start up behavior becomes a group action that includes the Initialize actions. Just something to think about; the flag is probably the most straightforward way to support this.