PetriNetSim
PetriNet
simulate
pick
s
step
Place
modify
t
Transition
inWeight
p
outWeight
p
enabled
fire
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="PetriNetSim" nsURI="http://www.petrinets.org/conceptsim" nsPrefix="sim">
  <eAnnotations source="transformation">
    <details key="technology" value="EOL"/>
    <details key="name" value="PetriNetSim.eol"/>
  </eAnnotations>
  <eAnnotations source="http://www.eclipse.org/OCL/Import">
    <details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
    <details key="ex" value="../structure/PetriNetsConcept.ecore#/"/>
  </eAnnotations>
  <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
    <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
  </eAnnotations>
  <eClassifiers xsi:type="ecore:EClass" name="PetriNet" eSuperTypes="../structure/PetriNetsConcept.ecore#//PetriNet">
    <eOperations name="simulate">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="post" value="self.trans()->select(t|t.oclAsType(Transition).enabled())->isEmpty()"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="pick" lowerBound="1" eType="#//Transition">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="s->any(true).oclAsType(Transition)"/>
        <details key="pre_someTransition" value="s->size()>0"/>
        <details key="post_coherentChoice" value="s->includes(pick(s))"/>
      </eAnnotations>
      <eParameters name="s" ordered="false" upperBound="-1" eType="ecore:EClass ../structure/PetriNetsConcept.ecore#//Transition"/>
    </eOperations>
    <eOperations name="step" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="post" value="self.places()->exists(p | p@pre.oclAsType(Place).tokens() &lt;> p.tokens())"/>
      </eAnnotations>
    </eOperations>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Place" eSuperTypes="../structure/PetriNetsConcept.ecore#//Place">
    <eOperations name="modify" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="post_retTrue" value="true"/>
        <details key="post_tokChange" value="self.tokens()@pre+t= self.tokens()"/>
      </eAnnotations>
      <eParameters name="t" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigInteger"/>
    </eOperations>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="../structure/PetriNetsConcept.ecore#//Transition">
    <eOperations name="inWeight" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="post" value="if (self.inputs()->includes(p)) then self.inWeight(p)>0 else self.inWeight(p)=0 endif"/>
      </eAnnotations>
      <eParameters name="p" eType="#//Place"/>
    </eOperations>
    <eOperations name="outWeight" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="post" value="if (self.outputs()->includes(p)) then self.outWeight(p)>0 else self.outWeight(p)=0 endif"/>
      </eAnnotations>
      <eParameters name="p" eType="#//Place"/>
    </eOperations>
    <eOperations name="enabled" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="composability">
        <details key="kind" value="conjunctive"/>
      </eAnnotations>
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="self.inputs()->forAll( p | p.tokens() > 0)"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="fire" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="self.inputs()->forAll ( p | p.oclAsType(Place).modify(-1)) and &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;self.outputs()->forAll ( p | p.oclAsType(Place).modify(1)) "/>
        <details key="post_inTokenChange" value="self.inputs()->forAll( p | p.tokens()@pre &lt; p.tokens())"/>
        <details key="post_outTokenChange" value="self.outputs()->forAll( p | p.tokens()@pre > p.tokens())"/>
      </eAnnotations>
    </eOperations>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"sim","nsURI":"http://www.petrinets.org/conceptsim","name":"PetriNetSim","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"PetriNet","instanceClass":null,"abstract":false,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Place","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Transition","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"ordered":true,"upperBound":1,"unique":true,"name":"simulate","lowerBound":0,"id":4,"many":false,"required":false,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"pick","lowerBound":1,"id":5,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"step","lowerBound":1,"id":6,"many":false,"required":true,"eClass":"EOperation"},{"id":7,"eClass":"EGenericType"},{"id":8,"eClass":"EGenericType"},{"ordered":false,"upperBound":-1,"unique":true,"name":"s","lowerBound":0,"id":9,"many":true,"required":false,"eClass":"EParameter"},{"id":10,"eClass":"EGenericType"},{"id":11,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"modify","lowerBound":1,"id":12,"many":false,"required":true,"eClass":"EOperation"},{"id":13,"eClass":"EGenericType"},{"id":14,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"t","lowerBound":1,"id":15,"many":false,"required":true,"eClass":"EParameter"},{"id":16,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"inWeight","lowerBound":1,"id":17,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"outWeight","lowerBound":1,"id":18,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"enabled","lowerBound":1,"id":19,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"fire","lowerBound":1,"id":20,"many":false,"required":true,"eClass":"EOperation"},{"id":21,"eClass":"EGenericType"},{"id":22,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"p","lowerBound":0,"id":23,"many":false,"required":false,"eClass":"EParameter"},{"id":24,"eClass":"EGenericType"},{"id":25,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"p","lowerBound":0,"id":26,"many":false,"required":false,"eClass":"EParameter"},{"id":27,"eClass":"EGenericType"},{"id":28,"eClass":"EGenericType"},{"id":29,"eClass":"EGenericType"}],"links":[{"source":0,"target":1},{"source":0,"target":2},{"source":0,"target":3},{"source":1,"target":0},{"source":1,"target":4},{"source":1,"target":5},{"source":1,"target":6},{"source":1,"target":7},{"source":4,"target":1},{"source":5,"target":3},{"source":5,"target":8},{"source":5,"target":1},{"source":5,"target":9},{"source":8,"target":3},{"source":9,"target":10},{"source":9,"target":5},{"source":6,"target":11},{"source":6,"target":1},{"source":2,"target":0},{"source":2,"target":12},{"source":2,"target":13},{"source":12,"target":14},{"source":12,"target":2},{"source":12,"target":15},{"source":15,"target":16},{"source":15,"target":12},{"source":3,"target":0},{"source":3,"target":17},{"source":3,"target":18},{"source":3,"target":19},{"source":3,"target":20},{"source":3,"target":21},{"source":17,"target":22},{"source":17,"target":3},{"source":17,"target":23},{"source":23,"target":2},{"source":23,"target":24},{"source":23,"target":17},{"source":24,"target":2},{"source":18,"target":25},{"source":18,"target":3},{"source":18,"target":26},{"source":26,"target":2},{"source":26,"target":27},{"source":26,"target":18},{"source":27,"target":2},{"source":19,"target":28},{"source":19,"target":3},{"source":20,"target":29},{"source":20,"target":3}],"multigraph":true}