我正在尝试在python循环中的openmodelica fmu中使用stepUntil函数进行交互式仿真。但是内存消耗非常大,需要200秒-14 GB并在不断增长。如何使用OMSimulator构建无限的模拟器?
public class Main {
public static void main(String[] args) {
// Tests
System.out.println(in1To10(1, true));
System.out.println(in1To10(2, true));
System.out.println(in1To10(10, true));
System.out.println(in1To10(11, true));
System.out.println(in1To10(1, false));
System.out.println(in1To10(2, false));
System.out.println(in1To10(10, false));
System.out.println(in1To10(11, false));
}
public static boolean in1To10(int n, boolean outsideMode) {
boolean returnValue = false;
if (outsideMode && (n <= 1 || n >= 10)) {
returnValue = true;
} else if (!outsideMode && (n >= 1 && n <= 10)) {
returnValue = true;
}
return returnValue;
}
}