defP2PN.tex 1.6 KB

123456789101112131415161718192021222324252627282930
  1. %\lstinputlisting[name=p2pn,numberstyle=\tiny,numbers=left,numberblanklines=true,frame=tb,firstnumber=1,firstline=61,lastline=87,caption=TODO,label=code:p2pn,captionpos=b]{code/simplepdltopetrinet/SimplePDLToPetriNet.t}%style=codesource,
  2. \begin{tomcode3}[caption=\texttt{P2PN :} Code de la définition \emph{ProcessToPetriNet},label=code:p2pn]
  3. definition P2PN traversal `TopDown(P2PN(tom__linkClass,pn)) {
  4. p@Process[name=name] -> {
  5. Place Pp_ready = `Place(name+"_ready", 1);
  6. Place Pp_running = `Place(name+"_running", 0);
  7. Place Pp_finished = `Place(name+"_finished", 0);
  8. %tracelink(Pt_start:Transition, `Transition(name+"_start", pn, 1, 1));
  9. %tracelink(Pt_finish:Transition, `Transition(name+"_finish", pn, 1, 1));
  10. `Arc(Pt_start, Pp_ready, pn, ArcKindnormal(), 1);
  11. `Arc(Pp_running, Pt_start, pn, ArcKindnormal(), 1);
  12. `Arc(Pt_finish, Pp_running, pn, ArcKindnormal(), 1);
  13. `Arc(Pp_finished, Pt_finish, pn, ArcKindnormal(), 1);
  14. WorkDefinition from = `p.getFrom();
  15. if (from!=null) {
  16. /* WDt_start et WDt_finish : transitions de l'image d'une activit#\colcode{black}{é}# que
  17. d#\colcode{black}{é}#crit le processus, par exemple B dans la figure#\colcode{black}{~\ref{fig:petrinetusecase}}# */
  18. Transition source = %resolve(from:WorkDefinition, WDt_start:Transition);
  19. source.setNet(pn);
  20. Arc tmpZoomIn = `Arc(Pp_ready, source, pn, ArcKindnormal(), 1);
  21. Transition target = %resolve(from:WorkDefinition, WDt_finish:Transition);
  22. target.setNet(pn);
  23. Arc tmpZoomOut = `Arc(target, Pp_finished, pn, ArcKindread_arc(), 1);
  24. }
  25. }
  26. }
  27. \end{tomcode3}