|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.liu.ida.critiquer.activities.parameters.AgentParameter
public class AgentParameter
One or several agents that are supposed to perform some action are collected by an AgentParameter. The AgentParameter is also capable of producing a graphical panel presenting those agents. The AgentParameter is connected to a Commander, which in turn is connected to one or several activities through CommanderParameters of the activities. Therefore this is not an ActivityParameter but only a Parameter.
This parameter is special in that it doesn't contain a value in itself but relies on a mapping between activities and agents that the commander has.
The reason for this is that ...
Constructor Summary | |
---|---|
AgentParameter(String string,
Commander commander)
|
Method Summary | |
---|---|
void |
agentChanged(Agent agent)
Whenever parameters that describe the agent change, propagate that information to the activity containing this agent |
boolean |
deSelectAgent(Agent agent,
Activity activity)
Check with the consistency checkers in Activity if it is OK to remove this agent and remove it in such case. |
Point |
getAgentLocation(Agent agent)
|
JPanel |
getAgentPanel()
|
Commander |
getCommander()
|
HashSet<Agent> |
getValue()
We are not supposed to use this method for the agent parameter since the Commander keeps track of all agent-activity mappings. |
boolean |
hasValue()
|
boolean |
selectAgent(Agent a)
Check if it is ok to add this agent to the list of agents and do so if possible. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AgentParameter(String string, Commander commander)
Method Detail |
---|
public JPanel getAgentPanel()
public Point getAgentLocation(Agent agent)
public HashSet<Agent> getValue()
We are not supposed to use this method for the agent parameter since the Commander keeps track of all agent-activity mappings.
AgentParameter objects are not connected to a single activity either so it makes no sense asking for the value of this parameter
To obtain a list of the agents taking part of an activity, use
getValue
in interface Parameter<HashSet<Agent>>
ActivityParameter.getValue()
public boolean hasValue()
hasValue
in interface Parameter<HashSet<Agent>>
public boolean selectAgent(Agent a)
a
-
public boolean deSelectAgent(Agent agent, Activity activity)
agent
- public String toString()
toString
in class Object
public void agentChanged(Agent agent)
agentChanged
in interface AgentChangedListener
public Commander getCommander()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |