defWS2PN.tex 1.3 KB

12345678910111213141516171819202122232425262728
  1. %\lstinputlisting[name=ws2pn,numberstyle=\tiny,numbers=left,numberblanklines=true,frame=tb,firstnumber=1,firstline=120,lastline=146,caption=TODO,label=code:ws2pn,captionpos=b]{code/simplepdltopetrinet/SimplePDLToPetriNet.t}
  2. \begin{tomcode3}[caption=\texttt{WS2PN :} Code de la définition \emph{WorkSequenceToPetriNet},label=code:ws2pn]
  3. definition WS2PN traversal `TopDown(WS2PN(tom__linkClass,pn)) {
  4. ws@WorkSequence[predecessor=p,successor=s,linkType=linkType] -> {
  5. Place source= null;
  6. Transition target= null;
  7. %match(linkType) {
  8. (WorkSequenceTypefinishToFinish|WorkSequenceTypefinishToStart)[] -> {
  9. source = %resolve(p:WorkDefinition, WDp_finished:Place);
  10. }
  11. (WorkSequenceTypestartToStart|WorkSequenceTypestartToFinish)[] -> {
  12. source = %resolve(p:WorkDefinition, WDp_started:Place);
  13. }
  14. (WorkSequenceTypefinishToStart|WorkSequenceTypestartToStart)[] -> {
  15. target = %resolve(s:WorkDefinition, WDt_start:Transition);
  16. }
  17. (WorkSequenceTypestartToFinish|WorkSequenceTypefinishToFinish)[] -> {
  18. target = %resolve(s:WorkDefinition, WDt_finish:Transition);
  19. }
  20. }
  21. source.setNet(pn);
  22. target.setNet(pn);
  23. Arc wsImage = `Arc(target,source, pn, ArcKindread_arc(), 1);
  24. }
  25. }
  26. \end{tomcode3}