|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ptolemy.fmi.driver.FMUDriver org.ptolemy.fmi.driver.FMUCoSimulation
public class FMUCoSimulation
Read a Functional Mock-up Unit .fmu file and invoke it as a co-simulation.
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) |
Field Summary |
---|
Fields inherited from class org.ptolemy.fmi.driver.FMUDriver |
---|
_csvSeparator, _enableLogging, _endTime, _fmuFileName, _modelIdentifier, _nativeLibrary, _outputFileName, _stepSize |
Constructor Summary | |
---|---|
FMUCoSimulation()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.ptolemy.fmi.driver.FMUDriver |
---|
_processArgs, _setEnableLogging, getFunction, invoke, invoke |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FMUCoSimulation()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
Usage:
java -classpath ../../../lib/jna.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.jar:${PTII} org.ptolemy.fmi.driver.FMUCoSimulation \ $PTII/org/ptolemy/fmi/fmu/cs/bouncingBall.fmu 1.0 0.1 true c foo.csv
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |