org.ptolemy.fmi
Class FMIModelDescription

java.lang.Object
  extended by org.ptolemy.fmi.FMIModelDescription

public class FMIModelDescription
extends java.lang.Object

An object that represents the fmiModelDescription element of a modelDescription.xml file contained within a Functional Mock-up Interface (.fmu) file.

A Functional Mock-up Unit file is a .fmu file in zip format that contains a .xml file named "modelDescription.xml". This class is a representation of the elements of that file.

FMI documentation may be found at http://www.modelisar.com/fmi.html.

Version:
$Id: FMIModelDescription.java 65987 2013-03-29 01:53:36Z cxh $
Author:
Christopher Brooks
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Field Summary
private  FMULibrary.FMUAllocateMemory _fmuAllocateMemory
          A class that allocates memory, but retains a reference so that the memory does not get gc'd.
private  com.sun.jna.NativeLibrary _nativeLibrary
          The NativeLibrary associated with the platform-dependent shared library in the .fmu file.
 boolean canGetAndSetFMUstate
          For FMI 2.0 and greater, the XML file may specify that the FMU supports getting and setting its state.
 FMICoSimulationCapabilities capabilities
          The capabilities for co-simulation.
 java.util.List<java.io.File> files
          The list of files that were extracted from the .fmu file.
 java.lang.String fmiVersion
          The fmiVersion, typically the value of the fmiVersion attribute from a .fmu file.
 java.lang.String guid
          The FMI guid, typically the value of the guid attribute from a .fmu file.
 java.lang.String modelIdentifier
          The FMI modelIdentifier, typically the value of the modelIdentifier attribute from a .fmu file.
 java.lang.String modelName
          The FMI modelName, typically the value of the modelName attribute from a .fmu file.
 java.util.List<FMIScalarVariable> modelVariables
          The list of ScalarVariable elements.
 int numberOfContinuousStates
          Number of continuous states.
 int numberOfEventIndicators
          Number of event indicators.
 java.util.Map<java.lang.String,java.lang.String> typeDefinitions
          A map from TypeDefinition type name declarations to the defined type name.
 
Constructor Summary
FMIModelDescription()
           
 
Method Summary
 void dispose()
          Unload the native library and free up any Java references to memory allocated by the allocate memory callback.
 FMULibrary.FMUAllocateMemory getFMUAllocateMemory()
          A class that allocates memory, but retains a reference so that the memory does not get gc'd.
 com.sun.jna.NativeLibrary getNativeLibrary()
          Get the native library of C functions for the current platform.
 java.lang.String toString()
          Return the value of the FMI modelName element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

canGetAndSetFMUstate

public boolean canGetAndSetFMUstate
For FMI 2.0 and greater, the XML file may specify that the FMU supports getting and setting its state. This defaults to false if not present in the XML file.


files

public java.util.List<java.io.File> files
The list of files that were extracted from the .fmu file.


fmiVersion

public java.lang.String fmiVersion
The fmiVersion, typically the value of the fmiVersion attribute from a .fmu file. The fmiVersion field is set to 1.0 for FMI 1.0.


guid

public java.lang.String guid
The FMI guid, typically the value of the guid attribute from a .fmu file. The value of guid in the modelDescription.xml file must match the guid in the shared library.


modelIdentifier

public java.lang.String modelIdentifier
The FMI modelIdentifier, typically the value of the modelIdentifier attribute from a .fmu file. The modelIdentifier is the basename for the shared library.


modelName

public java.lang.String modelName
The FMI modelName, typically the value of the modelName attribute from a .fmu file. The modelName may have spaces in it.


modelVariables

public java.util.List<FMIScalarVariable> modelVariables
The list of ScalarVariable elements.


numberOfContinuousStates

public int numberOfContinuousStates
Number of continuous states.


numberOfEventIndicators

public int numberOfEventIndicators
Number of event indicators.


typeDefinitions

public java.util.Map<java.lang.String,java.lang.String> typeDefinitions
A map from TypeDefinition type name declarations to the defined type name.


capabilities

public FMICoSimulationCapabilities capabilities
The capabilities for co-simulation.


_nativeLibrary

private com.sun.jna.NativeLibrary _nativeLibrary
The NativeLibrary associated with the platform-dependent shared library in the .fmu file.


_fmuAllocateMemory

private FMULibrary.FMUAllocateMemory _fmuAllocateMemory
A class that allocates memory, but retains a reference so that the memory does not get gc'd.

Constructor Detail

FMIModelDescription

public FMIModelDescription()
Method Detail

dispose

public void dispose()
Unload the native library and free up any Java references to memory allocated by the allocate memory callback.


getFMUAllocateMemory

public FMULibrary.FMUAllocateMemory getFMUAllocateMemory()
A class that allocates memory, but retains a reference so that the memory does not get gc'd.


getNativeLibrary

public com.sun.jna.NativeLibrary getNativeLibrary()
                                           throws java.io.IOException
Get the native library of C functions for the current platform.

Returns:
The library of functions for the current platform.
Throws:
java.io.IOException - If the FMU file does not contain binaries for the current platform.

toString

public java.lang.String toString()
Return the value of the FMI modelName element.

Overrides:
toString in class java.lang.Object
Returns:
The model name.