Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr PNlib_PNlib.Examples.ExtTest.TDSTest.conf.json loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/PNlib 2.2.0-master/package.mo", uses=false) Using package PNlib with version 2.2 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/PNlib 2.2.0-master/package.mo) Using package ModelicaServices with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 3.2.3+maint.om/package.mo) Using package Modelica with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo) Using package Complex with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 3.2.3+maint.om/package.mo) Running command: translateModel(PNlib.Examples.ExtTest.TDSTest,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="P1.t|P2.t|T1.active|T1.fire|T1.putFireTime|Time",fileNamePrefix="PNlib_PNlib.Examples.ExtTest.TDSTest") translateModel(PNlib.Examples.ExtTest.TDSTest,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="P1.t|P2.t|T1.active|T1.fire|T1.putFireTime|Time",fileNamePrefix="PNlib_PNlib.Examples.ExtTest.TDSTest") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 3.2.3+maint.om/package.mo): time 0.0009463/0.0009464, allocations: 171.8 kB / 16.11 MB, free: 5.57 MB / 13.93 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo): time 1.674/1.674, allocations: 205.4 MB / 222.3 MB, free: 13.76 MB / 186.7 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 3.2.3+maint.om/package.mo): time 0.0009021/0.0009024, allocations: 90.28 kB / 270.6 MB, free: 13.27 MB / 234.7 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/PNlib 2.2.0-master/package.mo): time 0.06772/0.06772, allocations: 16.9 MB / 335.8 MB, free: 5.898 MB / 234.7 MB Notification: Performance of FrontEnd - loaded program: time 0.0004923/0.0004927, allocations: 10.22 kB / 398.2 MB, free: 45.96 MB / 282.7 MB Notification: Performance of FrontEnd - Absyn->SCode: time 0.12/0.1206, allocations: 51.69 MB / 449.8 MB, free: 15.86 MB / 298.7 MB Notification: Performance of FrontEnd - scodeFlatten: time 0.4193/0.5399, allocations: 83.33 MB / 0.5207 GB, free: 80.3 MB / 362.7 MB Notification: Performance of FrontEnd - mkProgramGraph: time 0.000409/0.5404, allocations: 72.78 kB / 0.5207 GB, free: 80.3 MB / 362.7 MB Notification: Performance of FrontEnd - DAE generated: time 0.07726/0.6177, allocations: 26.76 MB / 0.5469 GB, free: 63.7 MB / 362.7 MB Notification: Performance of FrontEnd: time 1.172e-06/0.6178, allocations: 0 / 0.5469 GB, free: 63.7 MB / 362.7 MB Notification: Performance of Transformations before backend: time 8.015e-05/0.6179, allocations: 20 kB / 0.5469 GB, free: 63.68 MB / 362.7 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 306 * Number of variables: 306 Notification: Performance of Generate backend data structure: time 0.005601/0.6235, allocations: 2.102 MB / 0.5489 GB, free: 61.38 MB / 362.7 MB Notification: Performance of prepare preOptimizeDAE: time 4.89e-05/0.6236, allocations: 8.031 kB / 0.549 GB, free: 61.38 MB / 362.7 MB Notification: Performance of preOpt normalInlineFunction (simulation): time 0.001768/0.6253, allocations: 215.5 kB / 0.5492 GB, free: 61.16 MB / 362.7 MB Notification: Performance of preOpt evaluateParameters (simulation): time 0.002316/0.6277, allocations: 0.7266 MB / 0.5499 GB, free: 60.39 MB / 362.7 MB Notification: Performance of preOpt simplifyIfEquations (simulation): time 0.0002729/0.628, allocations: 161.4 kB / 0.55 GB, free: 60.23 MB / 362.7 MB Notification: Performance of preOpt expandDerOperator (simulation): time 0.0007111/0.6287, allocations: 136 kB / 0.5502 GB, free: 60.09 MB / 362.7 MB Error: An independent subset of the model has imbalanced number of equations (226) and variables (222). variables: T1.outPlaces[1].disTransition T1.outPlaces[1].enabledByInPlaces T1.outPlaces[1].arcWeightint T1.outPlaces[1].arcWeight T1.outPlaces[1].fire T1.outPlaces[1].active T1.outPlaces[1].disPlace T1.outPlaces[1].enable T1.outPlaces[1].maxTokensint T1.outPlaces[1].maxTokens T1.outPlaces[1].tint T1.outPlaces[1].t T1.inPlaces[1].disTransition T1.inPlaces[1].arcWeightint T1.inPlaces[1].arcWeight T1.inPlaces[1].fire T1.inPlaces[1].active T1.inPlaces[1].normalArc T1.inPlaces[1].testValueint T1.inPlaces[1].testValue T1.inPlaces[1].tokenInOut T1.inPlaces[1].arcType T1.inPlaces[1].disPlace T1.inPlaces[1].enable T1.inPlaces[1].minTokensint T1.inPlaces[1].minTokens T1.inPlaces[1].tint T1.inPlaces[1].t T1.fire T1.active T1.tokenChange.numtrue T1.tokenChange.anytrue T1.tokenChange.vec[1] T1.enabledByOutPlaces T1.enabledByInPlaces T1.activation.active T1.activation.testValueInt[1] T1.activation.testValue[1] T1.activation.normalArc[1] T1.activation.disPlaceOut[1] T1.activation.disPlaceIn[1] T1.activation.firingCon T1.activation.maxTokensInt[1] T1.activation.maxTokens[1] T1.activation.minTokensInt[1] T1.activation.minTokens[1] T1.activation.arcWeightIntOut[1] T1.activation.arcWeightOut[1] T1.activation.arcWeightIntIn[1] T1.activation.arcWeightIn[1] T1.activation.arcType[1] T1.activation.tIntOut[1] T1.activation.tIntIn[1] T1.activation.tOut[1] T1.activation.tIn[1] T1.tokenInOut[1] T1.enableOut[1] T1.enableIn[1] T1.disPlaceOut[1] T1.disPlaceIn[1] T1.ani T1.delayPassed T1.normalArc[1] T1.testValueInt[1] T1.arcType[1] T1.tIntOut[1] T1.tIntIn[1] T1.maxTokensInt[1] T1.minTokensInt[1] T1.arcWeightIntOut[1] T1.arcWeightIntIn[1] T1.testValue[1] T1.maxTokens[1] T1.minTokens[1] T1.tOut[1] T1.tIn[1] T1.fireTime T1.r128 T1.color[2] T1.color[1] T1.putDelay T1.putFireTime T1.firingCon T1.arcWeightOut[1] T1.arcWeightIn[1] P2.inTransition[1].disPlace P2.inTransition[1].enable P2.inTransition[1].maxTokensint P2.inTransition[1].maxTokens P2.inTransition[1].tint P2.inTransition[1].t P2.inTransition[1].disTransition P2.inTransition[1].enabledByInPlaces P2.inTransition[1].arcWeightint P2.inTransition[1].arcWeight P2.inTransition[1].fire P2.inTransition[1].active P2.pd_t P2.enableIn.benefitLimit P2.enableIn.valid P2.enableIn.benefitMax P2.enableIn.Index P2.enableIn.endWhile P2.enableIn.sumEnablingProbTAin P2.enableIn.randNum P2.enableIn.posTE P2.enableIn.k P2.enableIn.nTAin P2.enableIn.nremTAin P2.enableIn.arcWeightSum P2.enableIn.cumEnablingProb[1] P2.enableIn.remTAin[1] P2.enableIn.TEin[1] P2.enableIn.state128[4] P2.enableIn.state128[3] P2.enableIn.state128[2] P2.enableIn.state128[1] P2.enableIn.TEin_[1] P2.enableIn.active[1] P2.enableIn.delayPassed P2.enableIn.disTransition[1] P2.enableIn.benefitType P2.enableIn.enablingBene[1] P2.enableIn.enablingProb[1] P2.enableIn.enablingPrio[1] P2.enableIn.enablingType P2.enableIn.TAein[1] P2.enableIn.maxTokens P2.enableIn.t P2.enableIn.arcWeight[1] P2.enableOut.t P2.firingSumOut.firingSum P2.firingSumIn.firingSum P2.firingSumIn.arcWeight[1] P2.firingSumIn.fire[1] P2.delayPassedIn.numtrue P2.delayPassedIn.anytrue P2.delayPassedIn.vec[1] P2.enabledByInPlaces[1] P2.activeIn[1] P2.disTransitionIn[1] P2.fireIn[1] P2.tokeninout P2.arcWeightIn[1] P2.pret P2.tokenscale P2.color[3] P2.color[2] P2.levelCon P2.reStart P2.t P1.outTransition[1].normalArc P1.outTransition[1].testValueint P1.outTransition[1].testValue P1.outTransition[1].tokenInOut P1.outTransition[1].arcType P1.outTransition[1].disPlace P1.outTransition[1].enable P1.outTransition[1].minTokensint P1.outTransition[1].minTokens P1.outTransition[1].tint P1.outTransition[1].t P1.outTransition[1].disTransition P1.outTransition[1].arcWeightint P1.outTransition[1].arcWeight P1.outTransition[1].fire P1.outTransition[1].active P1.pd_t P1.enableIn.t P1.enableOut.benefitLimit P1.enableOut.valid P1.enableOut.benefitMax P1.enableOut.Index P1.enableOut.endWhile P1.enableOut.sumEnablingProbTAout P1.enableOut.randNum P1.enableOut.posTE P1.enableOut.k P1.enableOut.nTAout P1.enableOut.nremTAout P1.enableOut.arcWeightSum P1.enableOut.cumEnablingProb[1] P1.enableOut.remTAout[1] P1.enableOut.TEout[1] P1.enableOut.state128[4] P1.enableOut.state128[3] P1.enableOut.state128[2] P1.enableOut.state128[1] P1.enableOut.TEout_[1] P1.enableOut.activeCon P1.enableOut.delayPassed P1.enableOut.disTransition[1] P1.enableOut.benefitType P1.enableOut.enablingBene[1] P1.enableOut.enablingProb[1] P1.enableOut.enablingPrio[1] P1.enableOut.enablingType P1.enableOut.TAout[1] P1.enableOut.minTokens P1.enableOut.t P1.enableOut.arcWeight[1] P1.firingSumOut.firingSum P1.firingSumOut.arcWeight[1] P1.firingSumOut.fire[1] P1.firingSumIn.firingSum P1.delayPassedOut.numtrue P1.delayPassedOut.anytrue P1.delayPassedOut.vec[1] P1.activeConOut.anychange P1.activeConOut.vec[1] P1.activeOut[1] P1.disTransitionOut[1] P1.fireOut[1] P1.tokeninout P1.arcWeightOut[1] P1.pret P1.tokenscale P1.color[3] P1.color[2] P1.levelCon P1.reStart P1.t equations: 1 : P1.reStart = false 2 : P1.activeConOut.vec = {pre(P1.activeOut[1])} and not {P1.disTransitionOut[1]} 3 : algorithm P1.activeConOut.anychange := false; for i in 1:1 loop P1.activeConOut.anychange := P1.activeConOut.anychange or change(P1.activeConOut.vec[i]); end for; 4 : P1.delayPassedOut.vec = {P1.activeOut[1]} and {P1.disTransitionOut[1]} 5 : algorithm P1.delayPassedOut.anytrue := false; P1.delayPassedOut.numtrue := 0; for i in 1:1 loop P1.delayPassedOut.anytrue := P1.delayPassedOut.anytrue or P1.delayPassedOut.vec[i]; if P1.delayPassedOut.vec[i] then P1.delayPassedOut.numtrue := 1 + P1.delayPassedOut.numtrue; end if; end for; 6 : algorithm P1.firingSumIn.firingSum := 0; 7 : P1.firingSumOut.fire = {P1.fireOut[1]} and {P1.disTransitionOut[1]} 8 : P1.firingSumOut.arcWeight = {P1.arcWeightOut[1]} 9 : algorithm P1.firingSumOut.firingSum := 0; for i in 1:1 loop if P1.firingSumOut.fire[i] then P1.firingSumOut.firingSum := P1.firingSumOut.firingSum + P1.firingSumOut.arcWeight[i]; end if; end for; 10 : P1.enableOut.arcWeight = {P1.arcWeightOut[1]} 11 : P1.enableOut.t = P1.pret 12 : P1.enableOut.minTokens = P1.minTokens 13 : P1.enableOut.TAout = {P1.activeOut[1]} 14 : P1.enableOut.enablingType = P1.enablingType 15 : P1.enableOut.enablingPrio = {1} 16 : P1.enableOut.enablingProb = {1.0} 17 : P1.enableOut.enablingBene = {1.0} 18 : P1.enableOut.benefitType = P1.benefitType 19 : P1.enableOut.disTransition = {P1.disTransitionOut[1]} 20 : P1.enableOut.delayPassed = P1.delayPassedOut.anytrue 21 : P1.enableOut.activeCon = P1.activeConOut.anychange 22 : algorithm P1.enableOut.TEout := {false}; P1.enableOut.arcWeightSum := 0; for i in 1:1 loop if P1.enableOut.TAout[i] and not P1.enableOut.disTransition[i] and P1.enableOut.t + (-P1.enableOut.arcWeightSum) - P1.enableOut.arcWeight[i] >= P1.enableOut.minTokens then P1.enableOut.TEout[i] := true; P1.enableOut.arcWeightSum := P1.enableOut.arcWeightSum + P1.enableOut.arcWeight[i]; end if; end for; when P1.enableOut.delayPassed or P1.enableOut.activeCon then if P1.enableOut.t - P1.enableOut.arcWeightSum >= P1.enableOut.minTokens then P1.enableOut.TEout := {P1.enableOut.TAout[1]}; else if P1.enableOut.enablingType == PNlib.Types.EnablingType.Priority then P1.enableOut.arcWeightSum := 0; for i in 1:1 loop P1.enableOut.Index := Modelica.Math.Vectors.find(/*Real*/(i), {/*Real*/(P1.enableOut.enablingPrio[1])}, 0.0); if P1.enableOut.Index > 0 and P1.enableOut.TAout[P1.enableOut.Index] and P1.enableOut.disTransition[P1.enableOut.Index] and P1.enableOut.t + (-P1.enableOut.arcWeightSum) - P1.enableOut.arcWeight[P1.enableOut.Index] >= P1.enableOut.minTokens then P1.enableOut.TEout[P1.enableOut.Index] := true; P1.enableOut.arcWeightSum := P1.enableOut.arcWeightSum + P1.enableOut.arcWeight[P1.enableOut.Index]; end if; end for; for i in 1:1 loop P1.enableOut.Index := Modelica.Math.Vectors.find(/*Real*/(i), {/*Real*/(P1.enableOut.enablingPrio[1])}, 0.0); if P1.enableOut.TAout[P1.enableOut.Index] and not P1.enableOut.disTransition[P1.enableOut.Index] and P1.enableOut.t + (-P1.enableOut.arcWeightSum) - P1.enableOut.arcWeight[P1.enableOut.Index] >= P1.enableOut.minTokens then P1.enableOut.TEout[P1.enableOut.Index] := true; P1.enableOut.arcWeightSum := P1.enableOut.arcWeightSum + P1.enableOut.arcWeight[P1.enableOut.Index]; end if; end for; elseif P1.enableOut.enablingType == PNlib.Types.EnablingType.Probability then P1.enableOut.remTAout := {0}; P1.enableOut.nremTAout := 0; P1.enableOut.arcWeightSum := 0; for i in 1:1 loop if P1.enableOut.TAout[i] and P1.enableOut.disTransition[i] then P1.enableOut.nremTAout := 1 + P1.enableOut.nremTAout; P1.enableOut.remTAout[P1.enableOut.nremTAout] := i; end if; end for; P1.enableOut.nTAout := P1.enableOut.nremTAout; if P1.enableOut.nTAout > 0 then P1.enableOut.sumEnablingProbTAout := sum(P1.enableOut.enablingProb[P1.enableOut.remTAout[1:P1.enableOut.nremTAout]]); P1.enableOut.cumEnablingProb := {0.0}; P1.enableOut.cumEnablingProb[1] := P1.enableOut.enablingProb[P1.enableOut.remTAout[1]] / P1.enableOut.sumEnablingProbTAout; for j in 2:P1.enableOut.nremTAout loop P1.enableOut.cumEnablingProb[j] := P1.enableOut.cumEnablingProb[-1 + j] + P1.enableOut.enablingProb[P1.enableOut.remTAout[j]] / P1.enableOut.sumEnablingProbTAout; end for; for i in 1:P1.enableOut.nTAout loop (P1.enableOut.randNum, P1.enableOut.state128) := Modelica.Math.Random.Generators.Xorshift128plus.random({pre(P1.enableOut.state128[1]), pre(P1.enableOut.state128[2]), pre(P1.enableOut.state128[3]), pre(P1.enableOut.state128[4])}); P1.enableOut.endWhile := false; P1.enableOut.k := 1; while P1.enableOut.k <= P1.enableOut.nremTAout and not P1.enableOut.endWhile loop if P1.enableOut.randNum <= P1.enableOut.cumEnablingProb[P1.enableOut.k] then P1.enableOut.posTE := P1.enableOut.remTAout[P1.enableOut.k]; P1.enableOut.endWhile := true; else P1.enableOut.k := 1 + P1.enableOut.k; end if; end while; if P1.enableOut.t + (-P1.enableOut.arcWeightSum) - P1.enableOut.arcWeight[P1.enableOut.posTE] >= P1.enableOut.minTokens then P1.enableOut.arcWeightSum := P1.enableOut.arcWeightSum + P1.enableOut.arcWeight[P1.enableOut.posTE]; P1.enableOut.TEout[P1.enableOut.posTE] := true; end if; P1.enableOut.nremTAout := -1 + P1.enableOut.nremTAout; if P1.enableOut.nremTAout > 0 then P1.enableOut.remTAout := PNlib.Functions.OddsAndEnds.deleteElementInt({P1.enableOut.remTAout[1]}, P1.enableOut.k); P1.enableOut.cumEnablingProb := {0.0}; P1.enableOut.sumEnablingProbTAout := sum(P1.enableOut.enablingProb[P1.enableOut.remTAout[1:P1.enableOut.nremTAout]]); if P1.enableOut.sumEnablingProbTAout > 0.0 then P1.enableOut.cumEnablingProb[1] := P1.enableOut.enablingProb[P1.enableOut.remTAout[1]] / P1.enableOut.sumEnablingProbTAout; for j in 2:P1.enableOut.nremTAout loop P1.enableOut.cumEnablingProb[j] := P1.enableOut.cumEnablingProb[-1 + j] + P1.enableOut.enablingProb[P1.enableOut.remTAout[j]] / P1.enableOut.sumEnablingProbTAout; end for; else P1.enableOut.cumEnablingProb[1:P1.enableOut.nremTAout] := fill(1.0 / /*Real*/(P1.enableOut.nremTAout), P1.enableOut.nremTAout); end if; end if; end for; end if; for i in 1:1 loop if P1.enableOut.TAout[i] and not P1.enableOut.disTransition[i] and P1.enableOut.t + (-P1.enableOut.arcWeightSum) - P1.enableOut.arcWeight[i] >= P1.enableOut.minTokens then P1.enableOut.TEout[i] := true; P1.enableOut.arcWeightSum := P1.enableOut.arcWeightSum + P1.enableOut.arcWeight[i]; end if; end for; else if P1.enableOut.benefitType == PNlib.Types.BenefitType.Greedy then P1.enableOut.TEout := PNlib.Functions.Enabling.benefitGreedyDisOut(1, {P1.enableOut.arcWeight[1]}, P1.enableOut.t, P1.enableOut.minTokens, {P1.enableOut.TAout[1]}, {P1.enableOut.enablingBene[1]}, {P1.enableOut.disTransition[1]}); elseif P1.enableOut.benefitType == PNlib.Types.BenefitType.BenefitQuotient then P1.enableOut.TEout := PNlib.Functions.Enabling.benefitQuotientDisOut(1, {P1.enableOut.arcWeight[1]}, P1.enableOut.t, P1.enableOut.minTokens, {P1.enableOut.TAout[1]}, {P1.enableOut.enablingBene[1]}, {P1.enableOut.disTransition[1]}); else P1.enableOut.arcWeightSum := 0; P1.enableOut.benefitMax := P1.enableOut.enablingBene[1]; P1.enableOut.benefitLimit := 0.0; (P1.enableOut.TEout, P1.enableOut.arcWeightSum, P1.enableOut.benefitMax, P1.enableOut.valid, P1.enableOut.benefitLimit) := PNlib.Functions.Enabling.benefitBaBDisOut(1, 1, {P1.enableOut.enablingBene[1]}, {P1.enableOut.arcWeight[1]}, {P1.enableOut.enablingBene[1] / /*Real*/(P1.enableOut.arcWeight[1])}, P1.enableOut.t, P1.enableOut.benefitMax, P1.enableOut.minTokens, {P1.enableOut.TEout[1]}, 0, P1.enableOut.benefitLimit, {P1.enableOut.TAout[1]}, {P1.enableOut.disTransition[1]}); end if; end if; end if; P1.enableOut.arcWeightSum := PNlib.Functions.OddsAndEnds.conditionalSumInt({P1.enableOut.arcWeight[1]}, {P1.enableOut.TAout[1]}); end when; for i in 1:1 loop P1.enableOut.TEout_[i] := P1.enableOut.TEout[i] and P1.enableOut.TAout[i]; end for; 23 : P1.enableIn.t = P1.pret 24 : P1.pd_t = P1.t 25 : P1.outTransition[1].active = P1.activeOut[1] 26 : P1.outTransition[1].fire = P1.fireOut[1] 27 : P1.outTransition[1].arcWeightint = P1.arcWeightOut[1] 28 : P1.outTransition[1].disTransition = P1.disTransitionOut[1] 29 : P1.outTransition[1].t = /*Real*/(P1.pret) 30 : P1.outTransition[1].tint = P1.pret 31 : P1.outTransition[1].minTokens = /*Real*/(P1.minTokens) 32 : P1.outTransition[1].minTokensint = P1.minTokens 33 : P1.outTransition[1].enable = P1.enableOut.TEout_[1] 34 : P1.outTransition[1].disPlace = true 35 : P1.outTransition[1].arcType = PNlib.Types.ArcType.NormalArc 36 : P1.outTransition[1].tokenInOut = pre(P1.tokeninout) 37 : P1.outTransition[1].testValue = -1.0 38 : P1.outTransition[1].testValueint = -1 39 : P1.outTransition[1].normalArc = false 40 : P1.pret = pre(P1.t) 41 : P1.tokeninout = pre(P1.firingSumIn.firingSum) > 0 or pre(P1.firingSumOut.firingSum) > 0 42 : P1.levelCon = /*Real*/(P1.t) * settings.M / /*Real*/(P1.N) 43 : P1.tokenscale = /*Real*/(P1.t) * settings.scale 44 : P1.color[2] = if settings.animatePlace then if P1.tokenscale < 100.0 then 255.0 + (-2.55) * P1.tokenscale else 0.0 else 255.0 45 : P1.color[3] = if settings.animatePlace then if P1.tokenscale < 100.0 then 255.0 + (-2.55) * P1.tokenscale else 0.0 else 255.0 46 : P2.reStart = false 47 : P2.delayPassedIn.vec = {P2.activeIn[1]} and {P2.disTransitionIn[1]} 48 : algorithm P2.delayPassedIn.anytrue := false; P2.delayPassedIn.numtrue := 0; for i in 1:1 loop P2.delayPassedIn.anytrue := P2.delayPassedIn.anytrue or P2.delayPassedIn.vec[i]; if P2.delayPassedIn.vec[i] then P2.delayPassedIn.numtrue := 1 + P2.delayPassedIn.numtrue; end if; end for; 49 : P2.firingSumIn.fire = {P2.fireIn[1]} and {P2.disTransitionIn[1]} 50 : P2.firingSumIn.arcWeight = {P2.arcWeightIn[1]} 51 : algorithm P2.firingSumIn.firingSum := 0; for i in 1:1 loop if P2.firingSumIn.fire[i] then P2.firingSumIn.firingSum := P2.firingSumIn.firingSum + P2.firingSumIn.arcWeight[i]; end if; end for; 52 : algorithm P2.firingSumOut.firingSum := 0; 53 : P2.enableOut.t = P2.pret 54 : P2.enableIn.arcWeight = {P2.arcWeightIn[1]} 55 : P2.enableIn.t = P2.pret 56 : P2.enableIn.maxTokens = P2.maxTokens 57 : P2.enableIn.TAein = {P2.enabledByInPlaces[1]} and {P2.activeIn[1]} 58 : P2.enableIn.enablingType = P2.enablingType 59 : P2.enableIn.enablingPrio = {1} 60 : P2.enableIn.enablingProb = {1.0} 61 : P2.enableIn.enablingBene = {1.0} 62 : P2.enableIn.benefitType = P2.benefitType 63 : P2.enableIn.disTransition = {P2.disTransitionIn[1]} 64 : P2.enableIn.delayPassed = P2.delayPassedIn.anytrue 65 : P2.enableIn.active = {P2.activeIn[1]} 66 : algorithm P2.enableIn.TEin := {false}; P2.enableIn.arcWeightSum := 0; when P2.enableIn.delayPassed then if P2.enableIn.t + P2.enableIn.arcWeightSum <= P2.enableIn.maxTokens then P2.enableIn.TEin := {P2.enableIn.TAein[1]}; else if P2.enableIn.enablingType == PNlib.Types.EnablingType.Priority then P2.enableIn.arcWeightSum := 0; for i in 1:1 loop P2.enableIn.Index := Modelica.Math.Vectors.find(/*Real*/(i), {/*Real*/(P2.enableIn.enablingPrio[1])}, 0.0); if P2.enableIn.Index > 0 and P2.enableIn.TAein[P2.enableIn.Index] and P2.enableIn.disTransition[P2.enableIn.Index] and P2.enableIn.t + P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.Index] <= P2.enableIn.maxTokens then P2.enableIn.TEin[P2.enableIn.Index] := true; P2.enableIn.arcWeightSum := P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.Index]; end if; end for; for i in 1:1 loop P2.enableIn.Index := Modelica.Math.Vectors.find(/*Real*/(i), {/*Real*/(P2.enableIn.enablingPrio[1])}, 0.0); if P2.enableIn.TAein[P2.enableIn.Index] and not P2.enableIn.disTransition[P2.enableIn.Index] and P2.enableIn.t + P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.Index] <= P2.enableIn.maxTokens then P2.enableIn.TEin[P2.enableIn.Index] := true; P2.enableIn.arcWeightSum := P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.Index]; end if; end for; elseif P2.enableIn.enablingType == PNlib.Types.EnablingType.Probability then P2.enableIn.arcWeightSum := 0; P2.enableIn.remTAin := {0}; P2.enableIn.nremTAin := 0; for i in 1:1 loop if P2.enableIn.TAein[i] and P2.enableIn.disTransition[i] then P2.enableIn.nremTAin := 1 + P2.enableIn.nremTAin; P2.enableIn.remTAin[P2.enableIn.nremTAin] := i; end if; end for; P2.enableIn.nTAin := P2.enableIn.nremTAin; P2.enableIn.sumEnablingProbTAin := sum(P2.enableIn.enablingProb[P2.enableIn.remTAin[1:P2.enableIn.nremTAin]]); P2.enableIn.cumEnablingProb := {0.0}; P2.enableIn.cumEnablingProb[1] := P2.enableIn.enablingProb[P2.enableIn.remTAin[1]] / P2.enableIn.sumEnablingProbTAin; for j in 2:P2.enableIn.nremTAin loop P2.enableIn.cumEnablingProb[j] := P2.enableIn.cumEnablingProb[-1 + j] + P2.enableIn.enablingProb[P2.enableIn.remTAin[j]] / P2.enableIn.sumEnablingProbTAin; end for; for i in 1:P2.enableIn.nTAin loop (P2.enableIn.randNum, P2.enableIn.state128) := Modelica.Math.Random.Generators.Xorshift128plus.random({pre(P2.enableIn.state128[1]), pre(P2.enableIn.state128[2]), pre(P2.enableIn.state128[3]), pre(P2.enableIn.state128[4])}); P2.enableIn.endWhile := false; P2.enableIn.k := 1; while P2.enableIn.k <= P2.enableIn.nremTAin and not P2.enableIn.endWhile loop if P2.enableIn.randNum <= P2.enableIn.cumEnablingProb[P2.enableIn.k] then P2.enableIn.posTE := P2.enableIn.remTAin[P2.enableIn.k]; P2.enableIn.endWhile := true; else P2.enableIn.k := 1 + P2.enableIn.k; end if; end while; if P2.enableIn.t + P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.posTE] <= P2.enableIn.maxTokens then P2.enableIn.arcWeightSum := P2.enableIn.arcWeightSum + P2.enableIn.arcWeight[P2.enableIn.posTE]; P2.enableIn.TEin[P2.enableIn.posTE] := true; end if; P2.enableIn.nremTAin := -1 + P2.enableIn.nremTAin; if P2.enableIn.nremTAin > 0 then P2.enableIn.remTAin := PNlib.Functions.OddsAndEnds.deleteElementInt({P2.enableIn.remTAin[1]}, P2.enableIn.k); P2.enableIn.cumEnablingProb := {0.0}; P2.enableIn.sumEnablingProbTAin := sum(P2.enableIn.enablingProb[P2.enableIn.remTAin[1:P2.enableIn.nremTAin]]); if P2.enableIn.sumEnablingProbTAin > 0.0 then P2.enableIn.cumEnablingProb[1] := P2.enableIn.enablingProb[P2.enableIn.remTAin[1]] / P2.enableIn.sumEnablingProbTAin; for j in 2:P2.enableIn.nremTAin loop P2.enableIn.cumEnablingProb[j] := P2.enableIn.cumEnablingProb[-1 + j] + P2.enableIn.enablingProb[P2.enableIn.remTAin[j]] / P2.enableIn.sumEnablingProbTAin; end for; else P2.enableIn.cumEnablingProb[1:P2.enableIn.nremTAin] := fill(1.0 / /*Real*/(P2.enableIn.nremTAin), P2.enableIn.nremTAin); end if; end if; end for; else if P2.enableIn.benefitType == PNlib.Types.BenefitType.Greedy then P2.enableIn.TEin := PNlib.Functions.Enabling.benefitGreedyDisIn(1, {P2.enableIn.arcWeight[1]}, P2.enableIn.t, P2.enableIn.maxTokens, {P2.enableIn.TAein[1]}, {P2.enableIn.enablingBene[1]}, {P2.enableIn.disTransition[1]}); elseif P2.enableIn.benefitType == PNlib.Types.BenefitType.BenefitQuotient then P2.enableIn.TEin := PNlib.Functions.Enabling.benefitQuotientDisIn(1, {P2.enableIn.arcWeight[1]}, P2.enableIn.t, P2.enableIn.maxTokens, {P2.enableIn.TAein[1]}, {P2.enableIn.enablingBene[1]}, {P2.enableIn.disTransition[1]}); else P2.enableIn.arcWeightSum := 0; P2.enableIn.benefitMax := P2.enableIn.enablingBene[1]; P2.enableIn.benefitLimit := 0.0; (P2.enableIn.TEin, P2.enableIn.arcWeightSum, P2.enableIn.benefitMax, P2.enableIn.valid, P2.enableIn.benefitLimit) := PNlib.Functions.Enabling.benefitBaBDisIn(1, 1, {P2.enableIn.enablingBene[1]}, {P2.enableIn.arcWeight[1]}, {P2.enableIn.enablingBene[1] / /*Real*/(P2.enableIn.arcWeight[1])}, P2.enableIn.t, P2.enableIn.benefitMax, P2.enableIn.maxTokens, {P2.enableIn.TEin[1]}, 0, P2.enableIn.benefitLimit, {P2.enableIn.TAein[1]}, {P2.enableIn.disTransition[1]}); end if; end if; end if; P2.enableIn.arcWeightSum := PNlib.Functions.OddsAndEnds.conditionalSumInt({P2.enableIn.arcWeight[1]}, {P2.enableIn.TAein[1]}); end when; for i in 1:1 loop P2.enableIn.TEin_[i] := P2.enableIn.TEin[i] and P2.enableIn.active[i]; end for; 67 : P2.pd_t = P2.t 68 : P2.inTransition[1].active = P2.activeIn[1] 69 : P2.inTransition[1].fire = P2.fireIn[1] 70 : P2.inTransition[1].arcWeightint = P2.arcWeightIn[1] 71 : P2.inTransition[1].enabledByInPlaces = P2.enabledByInPlaces[1] 72 : P2.inTransition[1].disTransition = P2.disTransitionIn[1] 73 : P2.inTransition[1].t = /*Real*/(P2.pret) 74 : P2.inTransition[1].tint = P2.pret 75 : P2.inTransition[1].maxTokens = /*Real*/(P2.maxTokens) 76 : P2.inTransition[1].maxTokensint = P2.maxTokens 77 : P2.inTransition[1].enable = P2.enableIn.TEin_[1] 78 : P2.inTransition[1].disPlace = true 79 : P2.pret = pre(P2.t) 80 : P2.tokeninout = pre(P2.firingSumIn.firingSum) > 0 or pre(P2.firingSumOut.firingSum) > 0 81 : P2.levelCon = /*Real*/(P2.t) * settings.M / /*Real*/(P2.N) 82 : P2.tokenscale = /*Real*/(P2.t) * settings.scale 83 : P2.color[2] = if settings.animatePlace then if P2.tokenscale < 100.0 then 255.0 + (-2.55) * P2.tokenscale else 0.0 else 255.0 84 : P2.color[3] = if settings.animatePlace then if P2.tokenscale < 100.0 then 255.0 + (-2.55) * P2.tokenscale else 0.0 else 255.0 85 : T1.arcWeightIn = {1.0} 86 : T1.arcWeightOut = {1.0} 87 : T1.firingCon = true 88 : T1.activation.tIn = {T1.tIn[1]} 89 : T1.activation.tOut = {T1.tOut[1]} 90 : T1.activation.tIntIn = {T1.tIntIn[1]} 91 : T1.activation.tIntOut = {T1.tIntOut[1]} 92 : T1.activation.arcType = {T1.arcType[1]} 93 : T1.activation.arcWeightIn = {T1.arcWeightIn[1]} 94 : T1.activation.arcWeightIntIn = {T1.arcWeightIntIn[1]} 95 : T1.activation.arcWeightOut = {T1.arcWeightOut[1]} 96 : T1.activation.arcWeightIntOut = {T1.arcWeightIntOut[1]} 97 : T1.activation.minTokens = {T1.minTokens[1]} 98 : T1.activation.minTokensInt = {T1.minTokensInt[1]} 99 : T1.activation.maxTokens = {T1.maxTokens[1]} 100 : T1.activation.maxTokensInt = {T1.maxTokensInt[1]} 101 : T1.activation.firingCon = T1.firingCon 102 : T1.activation.disPlaceIn = {T1.disPlaceIn[1]} 103 : T1.activation.disPlaceOut = {T1.disPlaceOut[1]} 104 : T1.activation.normalArc = {T1.normalArc[1]} 105 : T1.activation.testValue = {T1.testValue[1]} 106 : T1.activation.testValueInt = {T1.testValueInt[1]} 107 : algorithm T1.activation.active := true; for i in 1:1 loop if T1.activation.disPlaceIn[i] then if (T1.activation.arcType[i] == PNlib.Types.ArcType.NormalArc or not T1.activation.normalArc[i]) and not T1.activation.tIntIn[i] - T1.activation.arcWeightIntIn[i] >= T1.activation.minTokensInt[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.RealTestArc and not T1.activation.tIntIn[i] > T1.activation.testValueInt[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.TestArc and not T1.activation.tIntIn[i] >= T1.activation.testValueInt[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.RealInhibitorArc and not T1.activation.tIntIn[i] < T1.activation.testValueInt[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.InhibitorArc and not T1.activation.tIntIn[i] <= T1.activation.testValueInt[i] then T1.activation.active := false; end if; else if (T1.activation.arcType[i] == PNlib.Types.ArcType.NormalArc or not T1.activation.normalArc[i]) and not T1.activation.tIn[i] + (-T1.activation.arcWeightIn[i]) - T1.activation.minTokens[i] >= -1e-09 then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.RealTestArc and not T1.activation.tIn[i] > T1.activation.testValue[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.TestArc and not T1.activation.tIn[i] >= T1.activation.testValue[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.RealInhibitorArc and not T1.activation.tIn[i] < T1.activation.testValue[i] then T1.activation.active := false; elseif T1.activation.arcType[i] == PNlib.Types.ArcType.InhibitorArc and not T1.activation.tIn[i] <= T1.activation.testValue[i] then T1.activation.active := false; end if; end if; end for; for i in 1:1 loop if T1.activation.disPlaceOut[i] then if not T1.activation.tIntOut[i] + T1.activation.arcWeightIntOut[i] <= T1.activation.maxTokensInt[i] then T1.activation.active := false; end if; else if not T1.activation.tOut[i] + T1.activation.arcWeightOut[i] - T1.activation.maxTokens[i] <= 1e-09 then T1.activation.active := false; end if; end if; end for; T1.activation.active := T1.activation.active and T1.activation.firingCon; 108 : T1.enabledByInPlaces = PNlib.Functions.OddsAndEnds.allTrue({T1.enableIn[1]}) 109 : T1.enabledByOutPlaces = PNlib.Functions.OddsAndEnds.allTrue({T1.enableOut[1]}) 110 : T1.tokenChange.vec = {T1.tokenInOut[1]} 111 : algorithm T1.tokenChange.anytrue := false; T1.tokenChange.numtrue := 0; for i in 1:1 loop T1.tokenChange.anytrue := T1.tokenChange.anytrue or T1.tokenChange.vec[i]; if T1.tokenChange.vec[i] then T1.tokenChange.numtrue := 1 + T1.tokenChange.numtrue; end if; end for; 112 : T1.inPlaces[1].t = T1.tIn[1] 113 : T1.inPlaces[1].tint = T1.tIntIn[1] 114 : T1.inPlaces[1].minTokens = T1.minTokens[1] 115 : T1.inPlaces[1].minTokensint = T1.minTokensInt[1] 116 : T1.inPlaces[1].enable = T1.enableIn[1] 117 : T1.inPlaces[1].disPlace = T1.disPlaceIn[1] 118 : T1.inPlaces[1].arcType = T1.arcType[1] 119 : T1.inPlaces[1].tokenInOut = T1.tokenInOut[1] 120 : T1.inPlaces[1].testValue = T1.testValue[1] 121 : T1.inPlaces[1].testValueint = T1.testValueInt[1] 122 : T1.inPlaces[1].normalArc = T1.normalArc[1] 123 : T1.inPlaces[1].active = T1.delayPassed 124 : T1.inPlaces[1].fire = T1.fire 125 : T1.inPlaces[1].arcWeight = T1.arcWeightIn[1] 126 : T1.inPlaces[1].arcWeightint = T1.arcWeightIntIn[1] 127 : T1.inPlaces[1].disTransition = true 128 : T1.outPlaces[1].t = T1.tOut[1] 129 : T1.outPlaces[1].tint = T1.tIntOut[1] 130 : T1.outPlaces[1].maxTokens = T1.maxTokens[1] 131 : T1.outPlaces[1].maxTokensint = T1.maxTokensInt[1] 132 : T1.outPlaces[1].enable = T1.enableOut[1] 133 : T1.outPlaces[1].disPlace = T1.disPlaceOut[1] 134 : T1.outPlaces[1].active = T1.delayPassed 135 : T1.outPlaces[1].fire = T1.fire 136 : T1.outPlaces[1].arcWeight = T1.arcWeightOut[1] 137 : T1.outPlaces[1].arcWeightint = T1.arcWeightIntOut[1] 138 : T1.outPlaces[1].enabledByInPlaces = T1.enabledByInPlaces 139 : T1.outPlaces[1].disTransition = true 140 : T1.active = T1.activation.active and not pre(T1.delayPassed) 141 : T1.delayPassed = T1.active and time >= T1.putFireTime 142 : T1.fire = T1.enabledByOutPlaces 143 : T1.color[1] = if T1.fireTime + settings.timeFire >= time and settings.animateTransition and T1.ani then 255.0 else 0.0 144 : T1.color[2] = if T1.fireTime + settings.timeFire >= time and settings.animateTransition and T1.ani then 255.0 else 0.0 145 : T1.arcWeightIntIn[1] = if T1.disPlaceIn[1] then integer(T1.arcWeightIn[1]) else 1 146 : T1.arcWeightIntOut[1] = if T1.disPlaceOut[1] then integer(T1.arcWeightOut[1]) else 1 147 : algorithm when pre(T1.fire) then T1.putDelay := PNlib.Functions.Random.randomexp(T1.h, T1.r128); end when; when T1.active then T1.putFireTime := time + T1.putDelay; end when; 148 : P1.outTransition[1].active = T1.inPlaces[1].active 149 : P1.outTransition[1].arcType = T1.inPlaces[1].arcType 150 : P1.outTransition[1].arcWeight = T1.inPlaces[1].arcWeight 151 : P1.outTransition[1].arcWeightint = T1.inPlaces[1].arcWeightint 152 : P1.outTransition[1].disPlace = T1.inPlaces[1].disPlace 153 : P1.outTransition[1].disTransition = T1.inPlaces[1].disTransition 154 : P1.outTransition[1].enable = T1.inPlaces[1].enable 155 : P1.outTransition[1].fire = T1.inPlaces[1].fire 156 : P1.outTransition[1].minTokens = T1.inPlaces[1].minTokens 157 : P1.outTransition[1].minTokensint = T1.inPlaces[1].minTokensint 158 : P1.outTransition[1].normalArc = T1.inPlaces[1].normalArc 159 : P1.outTransition[1].t = T1.inPlaces[1].t 160 : P1.outTransition[1].testValue = T1.inPlaces[1].testValue 161 : P1.outTransition[1].testValueint = T1.inPlaces[1].testValueint 162 : P1.outTransition[1].tint = T1.inPlaces[1].tint 163 : P1.outTransition[1].tokenInOut = T1.inPlaces[1].tokenInOut 164 : P2.inTransition[1].active = T1.outPlaces[1].active 165 : P2.inTransition[1].arcWeight = T1.outPlaces[1].arcWeight 166 : P2.inTransition[1].arcWeightint = T1.outPlaces[1].arcWeightint 167 : P2.inTransition[1].disPlace = T1.outPlaces[1].disPlace 168 : P2.inTransition[1].disTransition = T1.outPlaces[1].disTransition 169 : P2.inTransition[1].enable = T1.outPlaces[1].enable 170 : P2.inTransition[1].enabledByInPlaces = T1.outPlaces[1].enabledByInPlaces 171 : P2.inTransition[1].fire = T1.outPlaces[1].fire 172 : P2.inTransition[1].maxTokens = T1.outPlaces[1].maxTokens 173 : P2.inTransition[1].maxTokensint = T1.outPlaces[1].maxTokensint 174 : P2.inTransition[1].t = T1.outPlaces[1].t 175 : P2.inTransition[1].tint = T1.outPlaces[1].tint 176 : when T1.fire then T1.fireTime := time; end when; 177 : when T1.fire then T1.ani := true; end when; 178 : when pre(P2.reStart) then P2.t := P2.reStartTokens; elsewhen {pre(P2.firingSumIn.firingSum) > 0, pre(P2.firingSumOut.firingSum) > 0} then P2.t := P2.pret + pre(P2.firingSumIn.firingSum) - pre(P2.firingSumOut.firingSum); end when; 179 : when pre(P1.reStart) then P1.t := P1.reStartTokens; elsewhen {pre(P1.firingSumIn.firingSum) > 0, pre(P1.firingSumOut.firingSum) > 0} then P1.t := P1.pret + pre(P1.firingSumIn.firingSum) - pre(P1.firingSumOut.firingSum); end when; Notification: Performance of preOpt clockPartitioning (simulation) : time 0.00637/0.6351, allocations: 4.199 MB / 0.5543 GB, free: 55.79 MB / 362.7 MB Error: pre-optimization module clockPartitioning (simulation) failed.