Interface IAgent

All Known Subinterfaces:
IBcastAlg, ITreeAlgAgent, ITreeDepAlg
All Known Implementing Classes:
DeployAgent, LambdaConstraintAgent, MorphAgent, MorphAgentGlbl, MorphAgentLcl, MorphAgentTestAlg, MoveCircleAgent, MoveToCentroidAgent, RandomAgent, RandomConstrainedAgent, SimpleAllAllBcast, SimpleFlockingAgent, SimpleRendezvousAgent, SwitchedCompoundAgent, TreeConstraintAgent, TreeDeployAgent, TreeDepthAgentCycle, TreeDepthAgentDefault, VicsekFlockingAgent

public interface IAgent

IAgent is the interface for robotic agents executing a distributed control law.

Because of the mixed discrete/continuous state of the system, this interface is designed to be handled by two different state evolution engines operating at two different time scales. GetDerivs (in IControlFunc, part of StateBundle) is intended for use in a numerical ODE solver that handles the continuous-time evolution of the system. The discrete state (ILogicVarBundle) and the message passing along the communication graph are handled by a discrete simulator, operating in bursts determined by the scheduler (ICommunicationScheduler).

Since:
1.0

Method Summary
 boolean checkStateValidity(StateBundle state)
          checks that a particular discrete state is valid for this agent
 void getMsgs(ILogicVarBundle discreteState, IDiscreteDynamicsCallback dynCallback, double[] arrLfStateCont, double lfCurrTime, int nIdxStateOffset, java.util.Iterator<CommLink> channelsToSendOn)
           Given the state of an agent, and the channels it can send messages on, push the next set of messages onto the appropriate channels.
 IAgent makeCopy()
          in case the agent has some internal state, this allows synchronized wrapper calls to cache a snapshot of the agent at some rational point in time.
 StateBundle updateState(ILogicVarBundle statePrev, double[] arrLfStateCont, double lfCurrTime, int nIdxStateOffset, IEnvironment env, java.util.Iterator<CommLink> channelsRecieveFrom)
           Given the previous state of an agent, and the channels to recieve messages from, recieve messages (destructively) and return new state (non-destructively).
 

Method Detail

checkStateValidity

boolean checkStateValidity(StateBundle state)
checks that a particular discrete state is valid for this agent


getMsgs

void getMsgs(ILogicVarBundle discreteState,
             IDiscreteDynamicsCallback dynCallback,
             double[] arrLfStateCont,
             double lfCurrTime,
             int nIdxStateOffset,
             java.util.Iterator<CommLink> channelsToSendOn)

Given the state of an agent, and the channels it can send messages on, push the next set of messages onto the appropriate channels. Channels are assumed to be modified by this operation. One weakness of this signature is that it requires programmer discipline not to look at the continuous state of agents other then your neighbors.

Parameters:
discreteState - discrete component of agent state
arrLfStateCont - global vector of continuous state
nIdxStateOffset - offset into global state vector corresonding to this agent.
channelsToSendOn - Iterator containing objects of type CommLink corresponding to channels to send messages on (neighbor indices can be ascertained from channels).
See Also:
for type handled by iterator

updateState

StateBundle updateState(ILogicVarBundle statePrev,
                        double[] arrLfStateCont,
                        double lfCurrTime,
                        int nIdxStateOffset,
                        IEnvironment env,
                        java.util.Iterator<CommLink> channelsRecieveFrom)

Given the previous state of an agent, and the channels to recieve messages from, recieve messages (destructively) and return new state (non-destructively).

Parameters:
statePrev - previous state (do not modify)
arrLfStateCont - vector of all continuous states (do not modify)
nIdxStateOffset - offset into arrLfStateCont corresponding to start of this agents continuous variables
channelsRecieveFrom - iterator storing CommLink classes corresponding incoming channels
Returns:
new state bundle containing discrete state of agent and new control function
See Also:
for type handled by iterator

makeCopy

IAgent makeCopy()
in case the agent has some internal state, this allows synchronized wrapper calls to cache a snapshot of the agent at some rational point in time. If the agent has no internal state, this function can just return "this".