public interface DynamicAgent extends HasNumericState
Modifier and Type | Method and Description |
---|---|
void |
addConstrainer(Constrainer c)
Adds a Constrainer to the list returned by
getConstrainers() . |
int |
addForce(double[] buf,
int idx) |
void |
addMasterAttachment(DynamicAttachment a)
Add a DynamicAttachment to the list of master attachments associated
with this component.
|
void |
addPosImpulse(double[] xbuf,
int xidx,
double h,
double[] vbuf,
int vidx) |
void |
addSolveBlock(SparseNumberedBlockMatrix S) |
void |
applyExternalForces() |
void |
applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed
gravity acceleration vector.
|
MatrixBlock |
createMassBlock()
Create a matrix block for representing the mass of this component,
initialized to the component's effective mass (instrinsic mass
plus the mass due to all attachmented components).
|
DynamicAttachment |
getAttachment()
Returns the slave attachment associated with this component, if any.
|
java.util.List<Constrainer> |
getConstrainers()
Returns a list of Constrainers associated with this component.
|
double |
getEffectiveMass()
Gets the effective scalar mass of this component.
|
void |
getEffectiveMass(Matrix M,
double t)
Gets the effective mass of this component at a particular time.
|
int |
getEffectiveMassForces(VectorNd f,
double t,
int idx)
Gets the mass forces for this component at a particular time.
|
int |
getForce(double[] buf,
int idx) |
void |
getInverseMass(Matrix Minv,
Matrix M)
Inverts a mass for this component.
|
double |
getMass(double t)
Returns the scalar mass of this component at time t.
|
void |
getMass(Matrix M,
double t)
Gets the mass of this component at a particular time.
|
java.util.LinkedList<DynamicAttachment> |
getMasterAttachments()
Returns a list of the attachments for which this component is a master, or
null if there are no such attachments.
|
int |
getPosDerivative(double[] buf,
int idx) |
int |
getPosState(double[] buf,
int idx) |
int |
getPosStateSize() |
int |
getSolveIndex() |
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
int |
getVelState(double[] buf,
int idx) |
int |
getVelStateSize() |
boolean |
hasForce()
Queries whether or not this component actually exerts its own
state-dependent forces (typically associated with damping).
|
boolean |
isActive()
Returns true if this component is active.
|
boolean |
isAttached()
Returns true if this component is attached.
|
boolean |
isControllable()
Returns true is this component is active, or it is attached to one
or more other components which ultimately are attached to at least
one active component.
|
boolean |
isDynamic()
Returns true if this component is dynamic.
|
boolean |
isMassConstant() |
boolean |
isParametric()
Returns true if the state of this component is determined parametrically;
i.e., it is neither dynamic nor attached.
|
int |
mulInverseEffectiveMass(Matrix M,
double[] a,
double[] f,
int idx) |
boolean |
removeConstrainer(Constrainer c)
Removes a Constrainer from the list returned by
getConstrainers() . |
void |
removeMasterAttachment(DynamicAttachment a)
Removes a DynamicAttachment from the list of master attachments associated
with this component.
|
void |
resetEffectiveMass()
Resets the effective mass of this component to the nominal mass.
|
void |
setAttached(DynamicAttachment attachment)
Attach this component to another via a DynamicAttachment object.
|
int |
setForce(double[] buf,
int idx) |
int |
setPosState(double[] buf,
int idx) |
void |
setRandomForce()
Sets the force of this component to a random value.
|
void |
setRandomPosState()
Sets the position state of this component to a random value.
|
void |
setRandomVelState()
Sets the velocity state of this component to a random value.
|
void |
setSolveIndex(int idx) |
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
int |
setVelState(double[] buf,
int idx) |
boolean |
velocityLimitExceeded(double tlimit,
double rlimit)
Checks if the current component velocity exceeds specified limits.
|
void |
zeroExternalForces() |
void |
zeroForces() |
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, hasState, numAuxVars, requiresAdvance, setAuxVarState
DynamicAttachment getAttachment()
java.util.LinkedList<DynamicAttachment> getMasterAttachments()
void setAttached(DynamicAttachment attachment)
attachment
- Specifies the attachment relationship between
this component and its master(s)void addMasterAttachment(DynamicAttachment a)
a
- master attachment to addvoid removeMasterAttachment(DynamicAttachment a)
a
- master attachment to removejava.util.List<Constrainer> getConstrainers()
transformGeometry()
on this component may require some of
its constrainers to be updated.void addConstrainer(Constrainer c)
getConstrainers()
.
This method is intended for internal use by the Constrainer components
themselves.c
- Constrainer to add the constrainer list.boolean removeConstrainer(Constrainer c)
getConstrainers()
. This method is intended for internal use by the
Constrainer components themselves.c
- Constrainer to remove from the constrainer list.true
if the constrainer was present in the list.boolean isDynamic()
boolean isActive()
boolean isAttached()
boolean isParametric()
boolean isControllable()
int getSolveIndex()
void setSolveIndex(int idx)
MatrixBlock createMassBlock()
boolean isMassConstant()
double getMass(double t)
void getMass(Matrix M, double t)
M
- matrix to return the mass int
- current timeint getEffectiveMassForces(VectorNd f, double t, int idx)
f
, starting at the location
specified by idx
. Upon return, this method should
return the value of idx
incremented by the dimension
of the mass forces.f
- vector to return the forces int
- current timeidx
- starting location within f
where forces should be storedidx
void getInverseMass(Matrix Minv, Matrix M)
Minv
- matrix to return the inverse mass inM
- matrix containing the mass to be invertedvoid resetEffectiveMass()
void getEffectiveMass(Matrix M, double t)
M
- matrix to return the mass int
- current timedouble getEffectiveMass()
int mulInverseEffectiveMass(Matrix M, double[] a, double[] f, int idx)
void addSolveBlock(SparseNumberedBlockMatrix S)
void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
int getPosDerivative(double[] buf, int idx)
int getPosState(double[] buf, int idx)
int setPosState(double[] buf, int idx)
int getVelState(double[] buf, int idx)
int setVelState(double[] buf, int idx)
int setForce(double[] buf, int idx)
int addForce(double[] buf, int idx)
int getForce(double[] buf, int idx)
int getPosStateSize()
int getVelStateSize()
void zeroForces()
void zeroExternalForces()
void applyExternalForces()
boolean velocityLimitExceeded(double tlimit, double rlimit)
tlimit
- translational velocity limitrlimit
- rotational velocity limitvoid applyGravity(Vector3d gacc)
void setRandomPosState()
void setRandomVelState()
void setRandomForce()
boolean hasForce()
Any action that alters the return value of this method should
propagate a StructureChangeEvent
. This can be
a state-not-changed event if component's state structure
is not altered (which it typically won't be).
true
if this component exerts its own forces.void getState(DataBuffer data)
HasNumericState
getState
in interface HasNumericState
data
- buffer for storing the state values.void setState(DataBuffer data)
HasNumericState
setState
in interface HasNumericState
data
- buffer containing the state information