artisynth.core.modelbase
Interface Model

All Superinterfaces:
Disposable, HasProperties, HasState, HierarchyNode, ModelComponent, Scannable
All Known Subinterfaces:
MechSystemModel
All Known Implementing Classes:
ArticulatedBeamBody, ArticulatedDemo, ArticulatedFem, AttachDemo, AttachedBeamDemo, BlockTest, ColoredFemBeam3d, CompliantConstraintDemo, ConstrainedParticle, CoupledSolveDemo, DoubleArmDemo, FallingSkull, Fem3dBlock, FemBeam3d, FemBeamMech, FemCollision, FemFrictionBeam, FemModel, FemModel3d, FemMuscleArm, FemMuscleDemo, FemMuscleModel, FemSingleTet, FemSkinDemo, FemSphere, FishDemo, FrameSpringDemo, Hex3dBlock, HexBeam3d, HexFrame, HexIncompress, HexSheet, HydrostatDemo, HydrostatInvDemo, HydrostatModel, HydrostatTubeDemo, LaymanBowl, LaymanDemo, LaymanModel, LockingDemo, LumbarSpringDemo, MassSpringDemo, MechModel, MechModelCollide, MechModelDemo, MechSystemBase, MFreeModel3d, MFreeMuscleModel, ModelBase, ModelBaseOld, MultiMuscleDemo, MultiSpringDemo, MuscleArm, NetDemo, PlanarConnectorDemo, PlaneConstrainedFem, PointForceDemo, PointModel, PointModel1d, PointModel2d, PointModel3d, PointToPointMuscle, PuddleDemo, PuppetDemo, QuadFishDemo, RenderableModelBase, RenderableModelBaseOld, RigidBodyCollision, RigidBodyDemo, RigidTentacle, RobustCube, RollPitchJointDemo, RootModel, SegmentedPlaneDemo, SelfCollision, SheetDemo, SimpleCollide, SingleHex, SinglePyramid, SingleQuadhex, SingleQuadpyramid, SingleQuadtet, SingleQuadwedge, SingleTet, SingleWedge, SkinDemo, SkullParticles, SphericalJointDemo, SpongeDemo, SpongeModel, SpringMeshDemo, Tentacle, TetBeam3d, ViscousBeam

public interface Model
extends ModelComponent, Disposable, HasState

Basic interface requirements for all Artisynth models


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Method Summary
 StepAdjustment advance(double t0, double t1, int flags)
          Advances this object from time t0 to time t1.
 void dispose()
          Called when the model is discarded.
 double getMaxStepSize()
          Returns the maximum step by which this object should be advanced within a simulation loop.
 void initialize(double t)
          Causes this model to initialize itself at time t.
 StepAdjustment preadvance(double t0, double t1, int flags)
          Prepares this object for advance from time t0 to time t1.
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getAllPropertyInfo, getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 
Methods inherited from interface artisynth.core.modelbase.HasState
createState, getInitialState, getState, setState
 

Method Detail

initialize

void initialize(double t)
Causes this model to initialize itself at time t. This method will be called at the very beginning of the simulation (with t = 0), or immediately after the model's state has been reset using HasState.setState(artisynth.core.modelbase.ComponentState), in which case t may have an arbitrary value.

Parameters:
t - initialization time (seconds)

preadvance

StepAdjustment preadvance(double t0,
                          double t1,
                          int flags)
Prepares this object for advance from time t0 to time t1. Often this method does nothing; it is provided in case a model needs to update internal state at the very beginning a step before input probes and controllers are applied.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

advance

StepAdjustment advance(double t0,
                       double t1,
                       int flags)
Advances this object from time t0 to time t1.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

getMaxStepSize

double getMaxStepSize()
Returns the maximum step by which this object should be advanced within a simulation loop.

Returns:
maximum step size (seconds)

dispose

void dispose()
Called when the model is discarded. Disposes of any resources used.

Specified by:
dispose in interface Disposable