madkit.simulation.probes
Class ReflexiveProbe

java.lang.Object
  extended by madkit.kernel.Probe
      extended by madkit.simulation.probes.ReflexiveProbe
Direct Known Subclasses:
BeeColorProbe, BeePointProbe, ObjectProbe

public class ReflexiveProbe
extends Probe

This class implements a dynamic probe on a given property.

Version:
3.0
Author:
Olivier Gutknecht, Fabien Michel

Field Summary
protected  java.util.Map fields
           
 
Constructor Summary
ReflexiveProbe(java.lang.String group, java.lang.String role, java.lang.String property)
           
ReflexiveProbe(java.lang.String community, java.lang.String group, java.lang.String role, java.lang.String property)
           
 
Method Summary
 void findFields()
           
 AbstractAgent getAgentNb(int nb)
           
 java.util.ListIterator getAgentsIterator()
          return a ListIterator orver the agents that handle the group/role couple
 boolean getBoolean(java.lang.Object theAgent)
           
 char getChar(java.lang.Object theAgent)
           
 java.lang.String getCommunity()
           
 java.util.List getCurrentAgentsList()
          return a list view (a snapshot at moment t) of the agents that handle the group/role couple (in proper sequence)
 double getDouble(java.lang.Object theAgent)
           
 java.lang.String getGroup()
           
 long getLong(java.lang.Object theAgent)
           
 java.lang.Object getObject(java.lang.Object theAgent)
           
 java.lang.String getProperty()
           
 int getPropertyCount()
           
 java.lang.String getRole()
           
 java.util.ListIterator getShuffledAgentsIterator()
          return a ListIterator that has been previously shuffled
 void initialize()
          this method is automatically invoked the first time the agents variable is updated so it's a good place to initialize activator's parameters like in the SingleMethodActivator for exemple
 int numberOfAgents()
          return the number of the agents that handle the group/role couple
 java.lang.String toString()
           
 void update(AbstractAgent theAgent, boolean added)
          this method is automatically invoked when changes occur on the considered group/role couple
 void updateFieldFor(java.lang.Object theAgent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fields

protected java.util.Map fields
Constructor Detail

ReflexiveProbe

public ReflexiveProbe(java.lang.String group,
                      java.lang.String role,
                      java.lang.String property)

ReflexiveProbe

public ReflexiveProbe(java.lang.String community,
                      java.lang.String group,
                      java.lang.String role,
                      java.lang.String property)
Method Detail

getProperty

public java.lang.String getProperty()

findFields

public void findFields()

initialize

public void initialize()
Description copied from class: Probe
this method is automatically invoked the first time the agents variable is updated so it's a good place to initialize activator's parameters like in the SingleMethodActivator for exemple

Overrides:
initialize in class Probe

update

public void update(AbstractAgent theAgent,
                   boolean added)
Description copied from class: Probe
this method is automatically invoked when changes occur on the considered group/role couple

Overrides:
update in class Probe
Parameters:
theAgent - is the agent which have been added or removed from the agents collection (a List)
added - is true is theAgent has been added to the agents, false if removed from it

updateFieldFor

public void updateFieldFor(java.lang.Object theAgent)

getDouble

public double getDouble(java.lang.Object theAgent)

getLong

public long getLong(java.lang.Object theAgent)

getBoolean

public boolean getBoolean(java.lang.Object theAgent)

getChar

public char getChar(java.lang.Object theAgent)

getObject

public java.lang.Object getObject(java.lang.Object theAgent)

getPropertyCount

public int getPropertyCount()

getAgentsIterator

public final java.util.ListIterator getAgentsIterator()
return a ListIterator orver the agents that handle the group/role couple

Since:
MadKit 3.0

getShuffledAgentsIterator

public final java.util.ListIterator getShuffledAgentsIterator()
return a ListIterator that has been previously shuffled

Since:
MadKit 3.0

getCurrentAgentsList

public final java.util.List getCurrentAgentsList()
return a list view (a snapshot at moment t) of the agents that handle the group/role couple (in proper sequence)

Since:
MadKit 3.0

numberOfAgents

public final int numberOfAgents()
return the number of the agents that handle the group/role couple


getAgentNb

public final AbstractAgent getAgentNb(int nb)

getCommunity

public final java.lang.String getCommunity()

getGroup

public final java.lang.String getGroup()

getRole

public final java.lang.String getRole()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.