public class FMUCoSimulation extends FMUDriver
Currently, FMI 1.0 and 2.0RC1 are supported.
This file is based on fmusdk/src/model_exchange/fmusim_me/main.c by Jakob Mauss, which has the following license:
FMU SDK license
Copyright (c) 2008-2011, QTronic GmbH. All rights reserved.
The FmuSdk is licensed by the copyright holder under the BSD License
(http://www.opensource.org/licenses/bsd-license.html):
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY QTRONIC GMBH "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL QTRONIC GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Red (cxh) |
Red (cxh) |
_csvSeparator, _enableLogging, _endTime, _fmiVersion, _fmuFileName, _modelIdentifier, _nativeLibrary, _outputFileName, _stepSize
Constructor and Description |
---|
FMUCoSimulation() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Perform co-simulation using the named Functional Mock-up Unit (FMU) file.
|
void |
simulate(java.lang.String fmuFileName,
double endTime,
double stepSize,
boolean enableLogging,
char csvSeparator,
java.lang.String outputFileName)
Perform co-simulation using the named Functional Mock-up Unit (FMU) file.
|
_processArgs, _setEnableLogging, getFunction, invoke, invoke, invoke
public static void main(java.lang.String[] args) throws java.lang.Exception
Usage:
java -classpath ../../../../lib/jna-4.0.0-variadic.jar:../../../.. \ org.ptolemy.fmi.driver.FMUCoSimulation \ file.fmu [endTime] [stepTime] [loggingOn] [csvSeparator] [outputFile]
For example, under Mac OS X or Linux:
java -classpath $PTII/lib/jna-4.0.0-variadic.jar:${PTII} org.ptolemy.fmi.driver.FMUCoSimulation \ ../fmu/cs/inc.fmu
The command line arguments have the following meaning:
The format of the arguments is based on the fmusim command from the fmusdk by QTronic Gmbh.
args
- The arguments: file.fmu [endTime] [stepTime]
[loggingOn] [csvSeparator] [outputFile]java.lang.Exception
- If there is a problem parsing the .fmu file or invoking
the methods in the shared library.public void simulate(java.lang.String fmuFileName, double endTime, double stepSize, boolean enableLogging, char csvSeparator, java.lang.String outputFileName) throws java.lang.Exception
simulate
in class FMUDriver
fmuFileName
- The pathname of the co-simulation .fmu fileendTime
- The ending time in seconds.stepSize
- The step size in seconds.enableLogging
- True if logging is enabled.csvSeparator
- The character used for separating fields.
Note that sometimes the decimal point in floats is converted to ','.outputFileName
- The output file.java.lang.Exception
- If there is a problem parsing the .fmu file or invoking
the methods in the shared library.