Class LambdaConstraintAgent

java.lang.Object
  extended by LambdaConstraintAgent
All Implemented Interfaces:
IAgent

public class LambdaConstraintAgent
extends java.lang.Object
implements IAgent


Constructor Summary
LambdaConstraintAgent()
           
LambdaConstraintAgent(double lfMaxVel)
           
LambdaConstraintAgent(double lfMaxVel, ICommStrengthFunc commFunc)
           
LambdaConstraintAgent(IAgent agentToWrap, double lfMaxVel)
           
LambdaConstraintAgent(IAgent agentToWrap, double lfMaxVel, double lfTCom, ICommStrengthFunc commFunc)
           
LambdaConstraintAgent(LambdaConstraintAgent src)
           
 
Method Summary
 boolean checkStateValidity(StateBundle state)
          checks that a particular discrete state is valid for this agent
 IBcastAlg getBcastAlg()
           
 java.lang.Double getLastBoundTime(int nAgent)
           
 double getLastLambdaLowBound(int nAgent)
           
 java.util.Vector<Jama.Matrix> getLastMatBounds(int nAgent)
           
 java.util.Vector<Jama.Matrix> getLastVelBounds(int nAgent)
           
 java.util.Vector<Jama.Matrix> getMatrixBounds(IPosBcast bcastPos, double lfCurrTime)
          temporarily making this public.
 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 getWrappedAgent()
           
 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 setBcastAlg(IBcastAlg bcastAlg)
           
 void setLambdaBounds(double lfLambdaMin, double lfLambdaMax)
          Sets lambda_+ and lambda_-
 void setLambdaIncrease(double lfLambdaIncrease)
           
 void setProjectParams(boolean bProject, double lfProjMax, double lfProjStep)
          sets parameters for projecting on to good motion.
 void setWrappedAgent(IAgent agentToWrap)
           
 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

LambdaConstraintAgent

public LambdaConstraintAgent()

LambdaConstraintAgent

public LambdaConstraintAgent(IAgent agentToWrap,
                             double lfMaxVel)

LambdaConstraintAgent

public LambdaConstraintAgent(IAgent agentToWrap,
                             double lfMaxVel,
                             double lfTCom,
                             ICommStrengthFunc commFunc)

LambdaConstraintAgent

public LambdaConstraintAgent(double lfMaxVel)

LambdaConstraintAgent

public LambdaConstraintAgent(double lfMaxVel,
                             ICommStrengthFunc commFunc)

LambdaConstraintAgent

public LambdaConstraintAgent(LambdaConstraintAgent src)
Method Detail

setProjectParams

public void setProjectParams(boolean bProject,
                             double lfProjMax,
                             double lfProjStep)
sets parameters for projecting on to good motion.

Parameters:
lfProjMax - maximum amount to rotate angle
lfProjStep - step angle

getLastVelBounds

public java.util.Vector<Jama.Matrix> getLastVelBounds(int nAgent)
Returns:
last calculated Laplacian matrix velocity bounds

getLastMatBounds

public java.util.Vector<Jama.Matrix> getLastMatBounds(int nAgent)
Returns:
last calculated Laplacian matrix bounds

getLastBoundTime

public java.lang.Double getLastBoundTime(int nAgent)

getLastLambdaLowBound

public double getLastLambdaLowBound(int nAgent)

setLambdaIncrease

public void setLambdaIncrease(double lfLambdaIncrease)

setLambdaBounds

public void setLambdaBounds(double lfLambdaMin,
                            double lfLambdaMax)
Sets lambda_+ and lambda_-


checkStateValidity

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

Specified by:
checkStateValidity in interface IAgent

getWrappedAgent

public IAgent getWrappedAgent()

setWrappedAgent

public void setWrappedAgent(IAgent agentToWrap)

getBcastAlg

public IBcastAlg getBcastAlg()

setBcastAlg

public void setBcastAlg(IBcastAlg bcastAlg)

getMsgs

public 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.

Specified by:
getMsgs in interface IAgent
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

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).

Specified by:
updateState in interface IAgent
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

getMatrixBounds

public java.util.Vector<Jama.Matrix> getMatrixBounds(IPosBcast bcastPos,
                                                     double lfCurrTime)
temporarily making this public. De-publicize later

Parameters:
bcastPos -
lfCurrTime -
Returns:

makeCopy

public 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. If the agent has no internal state, this function can just return "this".

Specified by:
makeCopy in interface IAgent