public class FMUImportHybrid extends FMUImport
FMUImport.Input, FMUImport.Output
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
(package private) int |
_proposedMicrostep
This is the proposed microstep.
|
(package private) Time |
_proposedTime
This is the time proposed in fire() from the FMU.
|
_callbacks, _callbacks20, _eventInfoJNI, _firstFire, _firstFireInIteration, _fmiCompletedIntegratorStepFunction, _fmiComponent, _fmiDoStepFunction, _fmiEnterContinuousTimeModeFunction, _fmiEnterInitializationModeFunction, _fmiExitInitializationModeFunction, _fmiGetContinuousStatesFunction, _fmiGetDerivativesFunction, _fmiGetDirectionalDerivativeFunction, _fmiGetEventIndicatorsFunction, _fmiGetIntegerStatusFunction, _fmiGetRealStatusFunction, _fmiJNIComponent, _fmiModelDescription, _fmiNewDiscreteStatesFunction, _fmiSetTimeFunction, _fmiSetupExperimentFunction, _fmiVersion, _isStrict, _lastCommitTime, _lastFireMicrostep, _lastFireTime, _modelInitialized, _newStates, _refinedStepSize, _relativeTolerance, _states, _stepSizeRejected, _suggestZeroStepSize, _threshold, _toleranceControlled, fmiVersion, fmuFile, modelExchange, persistentInputs, removeDirectDependency, stateVariablesAsInputPorts, suppressWarnings, useRawJNI, visible
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
FMUImportHybrid(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_allInputsAreKnown()
Returns true if all inputs are known.
|
protected Time |
_fmiDoStepHybrid(Time newTime,
int newMicrostep)
Advance from the last firing time or last commit time to the specified
time and microstep by calling fmiDoStep(), if necessary.
|
protected void |
_fmiInitialize()
Initialize the FMU.
|
protected void |
_getFmuOutputs()
Retrieve the outputs from the FMU.
|
protected void |
_setFmuInputs()
Iterate through the scalarVariables and set all the inputs
that are known.
|
protected void |
_setFMUScalarVariable(FMIScalarVariable scalar,
Token token)
Set a scalar variable of the FMU to the value of a Ptolemy token.
|
void |
fire()
Invoke set() and get() on the FMU for the currently known inputs.
|
Time |
getNextStepSize(Time proposedTime)
Compute the step size for the FMU.
|
static void |
importFMU(java.lang.Object originator,
FileParameter fmuFileParameter,
NamedObj context,
double x,
double y,
boolean modelExchange)
Import a FMUFile.
|
void |
initialize()
Initialize this FMU wrapper.
|
boolean |
postfire()
Override the base class to record the current time as the last commit
time.
|
void |
preinitialize()
Instantiate the slave FMU component.
|
_acceptFMU, _checkEventIndicators, _checkFmiCommon, _completedIntegratorStepNotNeeded, _debugToStdOut, _enterContinuousTimeMode, _enterEventMode, _fmiCompletedIntegratorStep, _fmiCompletedIntegratorStepJNI, _fmiDoStep, _fmiEnterContinuousTimeModeJNI, _fmiEnterEventModeJNI, _fmiFreeInstance, _fmiGetContinuousStates, _fmiGetContinuousStatesJNI, _fmiGetDerivatives, _fmiGetDerivativesJNI, _fmiGetEventIndicatorsJNI, _fmiGetRealJNI, _fmiInitializeJNI, _fmiInstantiateJNI, _fmiNewDiscreteStatesJNI, _fmiSetContinuousStates, _fmiSetContinuousStatesJNI, _fmiSetRealJNI, _fmiSetTime, _fmiSetTimeJNI, _fmiStatusDescription, _fmiTerminate, _fmiType2PtolemyType, _freeFMUState, _getInputs, _getOutputs, _getPortByNameOrDisplayName, _getStepSize, _hasQSSDirector, _importFMU, _isScalarAPtolemyInput, _newDiscreteStatesNeeded, _recordFMUState, _requestRefiringIfNecessary, _restoreFMUState, _setParameter, _skipIfKnown, _updateParameters, _useRawJNI, advance, attributeChanged, declareDelayDependency, getInputDependencyList, getScalarVariables, isStepSizeAccurate, isStrict, refinedStepSize, rollBackToCommittedState, runNativeFMU, suggestedStepSize, wrapup
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, iterate, newReceiver, outputPortList, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, iterate, prefire, stop, stopFire, terminate
addInitializable, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
int _proposedMicrostep
Time _proposedTime
public FMUImportHybrid(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be
contained by the proposed container.NameDuplicationException
- If the container already
has an actor with this name.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class FMUImport
IllegalActionException
- If the FMU indicates a failure.public static void importFMU(java.lang.Object originator, FileParameter fmuFileParameter, NamedObj context, double x, double y, boolean modelExchange) throws IllegalActionException, java.io.IOException
originator
- The originator of the change request.fmuFileParameter
- The .fmuFilecontext
- The context in which the FMU actor is created.x
- The x-axis value of the actor to be created.y
- The y-axis value of the actor to be created.modelExchange
- True if the FMU should be imported as
a model exchange FMU.IllegalActionException
- If there is a problem
instantiating the actor.java.io.IOException
- If there is a problem parsing the fmu file.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class FMUImport
IllegalActionException
- If the slave FMU cannot be
initialized.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class FMUImport
IllegalActionException
- If the step size was
rejected, if thrown while requesting refiring if necessary, if
thrown while the FMU state is being recorded or if thrown by
the superclass.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class FMUImport
IllegalActionException
- If it cannot be instantiated.public Time getNextStepSize(Time proposedTime) throws IllegalActionException
proposedTime
- The proposed timeIllegalActionException
- If thrown by while doing the step.protected boolean _allInputsAreKnown() throws IllegalActionException
IllegalActionException
- If throw while getting the width
of an input port or checking if an input port is known.protected void _fmiInitialize() throws IllegalActionException
_fmiInitialize
in class FMUImport
IllegalActionException
- If the FMU does not return fmiOK.protected Time _fmiDoStepHybrid(Time newTime, int newMicrostep) throws IllegalActionException
newTime
- The time to advance to.newMicrostep
- The microstep to advance to.IllegalActionException
- If fmiDoStep() returns
anything other than fmiDiscard or fmiOK.protected void _setFMUScalarVariable(FMIScalarVariable scalar, Token token) throws IllegalActionException
_setFMUScalarVariable
in class FMUImport
scalar
- the FMI scalar to be set.token
- the Ptolemy token that contains the value to be set.IllegalActionException
- If the scalar is of a type
that is not handled or if the type of the token does not match
the type of the scalar.protected void _getFmuOutputs() throws IllegalActionException
IllegalActionException
- If thrown while getting the inputs, determining
if the inputs are known or have a tokenprotected void _setFmuInputs() throws IllegalActionException
IllegalActionException
- If thrown while getting the inputs, determining
if the inputs are known or have a token