greatspn / SOURCES

Main repository of the GreatSPN framework
GNU General Public License v2.0
42 stars 13 forks source link

(SCPN) How to consume all Colored Tokens in a Place #56

Closed MarceloJads closed 5 months ago

MarceloJads commented 5 months ago

I've been trying to simulate a phase-type distribution with GreatSPN, but something is not right.

\ I want to remove all tokens from P1 and from P2 when T2 is fired. Moreover, T2 must be active only when at least one token is in P1 AND at least one token is in P2. But, when a token arrives at place P1, the transition T2 is already becoming available.

Am I doing something wrong?

amparore commented 5 months ago

Use Max[#P2, 1] instead of just #P2 for the arc weight, to avoid zero-weighted arcs. Beware that this extended syntax is only supported in the editor and in a few of the solvers.

MarceloJads commented 5 months ago

Use Max[#P2, 1] instead of just #P2 for the arc weight, to avoid zero-weighted arcs. Beware that this extended syntax is only supported in the editor and in a few of the solvers.

Thanks for the reply! That works well for places without a Color Domain, but when I put that Multiplicity (Max[#P2, 1]) on the arc between P2 and T2, it is not recognized.

amparore commented 5 months ago

Yes, there is no way in the current expression language to express this with colours.

MarceloJads commented 5 months ago

Yes, there is no way in the current expression language to express this with colours.

Oh, that's okay.