fr.lifl.jedi.gui.display.interactionDisplayer.model.tree
Class PerformedInteractionsFamilyNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by fr.lifl.jedi.gui.display.interactionDisplayer.model.tree.PerformedInteractionsDisplayableNode
          extended by fr.lifl.jedi.gui.display.interactionDisplayer.model.tree.PerformedInteractionsFamilyNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class PerformedInteractionsFamilyNode
extends PerformedInteractionsDisplayableNode

A node that represents the interactions performed by the different instances of a particular agent family.

Version:
JEDI V 2.3
Created the 15th June 2009 Modified the 25th January 2010
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
PerformedInteractionsFamilyNode(java.lang.Class<?> family)
          The family of the instances for which performed interactions are displayed.
 
Method Summary
 void afterUpdate(int step)
          This method has to be called after the update of this node.
 void beforeUpdate()
          This method has to be called before the update of this node.
 void buildTreeAccordingToOptions(OptionsModel model, int step)
          Builds the tree according to the options provided in the model.
 OrderedComboBoxModel getAliveAgents()
          Gets the set of alive agents that are involved in the simulation.
 OrderedComboBoxModel getAllAgents()
          Gets the set of all agents that where involved in the simulation.
 java.lang.Class<?> getFamily()
          Gets the family represented by this node.
 PerformedInteractionsInstanceNode getNodeForInstance(Agent a)
          Gets the node that represents the data of a particular agent.
 void setAlive(Agent a, int step)
          Tells the node that an agent instance is alive.
 void updateAgentSourceParticipation(Agent a, AbstractRealizableTuple<?> tuple, int step)
          Updates the data of an agent, in the case where that agent was the source of a particular interaction.
 void updateAgentTargetParticipation(Agent a, AbstractRealizableTuple<?> tuple, int step)
          Updates the data of an agent, in the case where that agent was the target of a particular interaction.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PerformedInteractionsFamilyNode

public PerformedInteractionsFamilyNode(java.lang.Class<?> family)
The family of the instances for which performed interactions are displayed.

Parameters:
family - the family of the instances for which performed interactions are displayed.
Method Detail

getNodeForInstance

public PerformedInteractionsInstanceNode getNodeForInstance(Agent a)
Gets the node that represents the data of a particular agent.

Parameters:
a - The agent for which the node is retrieved.
Returns:
The node that represents the data of a particular agent.

getFamily

public java.lang.Class<?> getFamily()
Gets the family represented by this node.

Returns:
the family represented by this node.

getAllAgents

public OrderedComboBoxModel getAllAgents()
Gets the set of all agents that where involved in the simulation.

Returns:
the set of all agents that where involved in the simulation.

getAliveAgents

public OrderedComboBoxModel getAliveAgents()
Gets the set of alive agents that are involved in the simulation. An agent is considered as alive if it is still in the environment.

Returns:
the set of alive agents that are involved in the simulation.

beforeUpdate

public void beforeUpdate()
This method has to be called before the update of this node.


setAlive

public void setAlive(Agent a,
                     int step)
Tells the node that an agent instance is alive.

Parameters:
a - The agent to tag as alive.

updateAgentSourceParticipation

public void updateAgentSourceParticipation(Agent a,
                                           AbstractRealizableTuple<?> tuple,
                                           int step)
Updates the data of an agent, in the case where that agent was the source of a particular interaction.

Parameters:
a - The agent that was the source of an interaction. Its family must be equal to the value returned by method getFamily().
tuple - The tuple that represents the interaction the agent performed.
step - The simulation step during which the interaction occurred.

updateAgentTargetParticipation

public void updateAgentTargetParticipation(Agent a,
                                           AbstractRealizableTuple<?> tuple,
                                           int step)
Updates the data of an agent, in the case where that agent was the target of a particular interaction.

Parameters:
a - The agent that was the target of an interaction. Its family must be equal to the value returned by method getFamily().
tuple - The tuple that represents the interaction the agent undergone.
step - The simulation step during which the interaction occurred.

afterUpdate

public void afterUpdate(int step)
This method has to be called after the update of this node.

Parameters:
step - The simulation step for which the update was made.

buildTreeAccordingToOptions

public void buildTreeAccordingToOptions(OptionsModel model,
                                        int step)
Description copied from class: PerformedInteractionsDisplayableNode
Builds the tree according to the options provided in the model.

Specified by:
buildTreeAccordingToOptions in class PerformedInteractionsDisplayableNode
Parameters:
model - The model in which display options are stored.
step - The current time step of the simulation.
See Also:
PerformedInteractionsDisplayableNode.buildTreeAccordingToOptions(fr.lifl.jedi.gui.display.interactionDisplayer.model.OptionsModel, int)