|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object MorphAgentTestAlg
public class MorphAgentTestAlg
Implementation of IAgent for formation morphing algorithm.
Associated state is described in TreeAgentState
TreeAgentState
Constructor Summary | |
---|---|
MorphAgentTestAlg()
|
|
MorphAgentTestAlg(double lfRobotVelocity)
|
|
MorphAgentTestAlg(MorphAgentTestAlg src)
|
Method Summary | |
---|---|
boolean |
checkStateValidity(StateBundle state)
checks that a particular discrete state is valid for this agent. |
void |
getMsgs(ILogicVarBundle state,
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 syncrhonized wrapper calls to cache a snapshot of the agent at some rational point in time. |
void |
setMotionParams(double lfVel,
double lfTCom,
double lfRad)
|
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MorphAgentTestAlg()
public MorphAgentTestAlg(double lfRobotVelocity)
public MorphAgentTestAlg(MorphAgentTestAlg src)
Method Detail |
---|
public void setMotionParams(double lfVel, double lfTCom, double lfRad)
public boolean checkStateValidity(StateBundle state)
checkStateValidity
in interface IAgent
public void getMsgs(ILogicVarBundle state, 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.
getMsgs
in interface IAgent
state
- discrete component of agent statearrLfStateCont
- global vector of continuous statenIdxStateOffset
- offset into global state vector
corresonding to this agent.channelsToSendOn
- IteratorCommLink
public 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).
updateState
in interface IAgent
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 variableschannelsRecieveFrom
- iterator storing CommLink
classes corresponding incoming channels
CommLink
public IAgent makeCopy()
makeCopy
in interface IAgent
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |