本文整理汇总了Java中de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet类的典型用法代码示例。如果您正苦于以下问题:Java IFNet类的具体用法?Java IFNet怎么用?Java IFNet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFNet类属于de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet包,在下文中一共展示了IFNet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
public IFNet parse() throws ParserConfigurationException, SAXException, IOException {
Document doc = getDOM();
insertElements(doc);
//insertTransition(doc);
insertTransitionsFromEdges(doc);
//processSplitAndJoinNodes(doc);
aristaFlowElementsToIFnet();
loadNames(doc);
setInitialMarking();
loadOriginators(doc);
return net;
}
示例2: createModelChecker
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
public static ModelChecker createModelChecker(ViewComponent comp) {
ModelChecker mc = null;
if (comp instanceof PTNetEditorComponent) {
mc = new PRISM((PTNet) ((PTNetEditorComponent) comp).netContainer.getPetriNet());
} else if (comp instanceof CPNEditorComponent) {
mc = new PRISM((CPN) ((CPNEditorComponent) comp).netContainer.getPetriNet());
} else if (comp instanceof IFNetEditorComponent) {
mc = new PRISM((IFNet) ((IFNetEditorComponent) comp).netContainer.getPetriNet());
} else if (comp instanceof LogFileViewer) {
mc = new SCIFF(((LogFileViewer) comp));
} else if (comp instanceof LogViewViewer) {
mc = new SCIFF(((LogViewViewer) comp));
}
return mc;
}
示例3: testDeclassificationTransitionClone
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testDeclassificationTransitionClone() {
IFNet sNet = IFNetTestUtil.createSimpleIFNetWithDeclassificationNoAC();
DeclassificationTransition t = (DeclassificationTransition) sNet.getTransition("td");
t.setSilent(true);
DeclassificationTransition tClone = t.clone();
assertEquals(t, tClone);
assertNotSame(t, tClone);
assertTrue(tClone.isSilent());
assertEquals(t.getName(), tClone.getName());
assertEquals(t.getLabel(), tClone.getLabel());
assertEquals(t.isPlace(), tClone.isPlace());
assertEquals(t.isDrain(), tClone.isDrain());
assertEquals(t.isSource(), tClone.isSource());
assertEquals(t.isTransition(), tClone.isTransition());
}
示例4: testCheckValidityCreateDelete
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testCheckValidityCreateDelete() throws ParameterException {
// Get a simple standard SNet and one of its transtitions
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition rt = (RegularIFNetTransition) sNet.getTransition("t0");
// Set "create" and "delete" mode for one color
HashSet<AccessMode> cdAccess = new HashSet<AccessMode>();
cdAccess.add(AccessMode.DELETE);
cdAccess.add(AccessMode.CREATE);
rt.setAccessMode("pink", cdAccess);
try {
rt.checkValidity();
fail("A transition with create and delete on the same color is not valid!.");
} catch (PNValidationException e1) {
}
}
示例5: testCheckValidityProcess
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testCheckValidityProcess() throws ParameterException {
// Get a simple standard SNet and one of its transitions
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition rt = (RegularIFNetTransition) sNet.getTransition("t0");
// Set "read" to a consumed but not produced color
HashSet<AccessMode> rAccess = new HashSet<AccessMode>();
rAccess.add(AccessMode.READ);
rt.setAccessMode("red", rAccess);
try {
rt.checkValidity();
fail("A token color which is only read must be consumed and produced.");
} catch (PNValidationException e1) {
}
}
示例6: testCheckStateNotEnoughOutputSpace
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testCheckStateNotEnoughOutputSpace() throws ParameterException {
// Get a simple standard SNet ...
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("tIn");
// check the state is enabled initially
trans.checkState();
assertTrue("An enabled transition is reported to be disabled", trans.isEnabled());
// ... add a green token to place p0
IFNetPlace p0 = sNet.getPlace("p0");
p0.setState(new Multiset<String>("green"));
// check the state of a now disabled transition
trans.checkState();
assertFalse("A disabled transition is reported to be enabled", trans.isEnabled());
// removing of green enables the transition again
// p0.getState().clear(); cleaning a clone dosn't make sense
p0.setState(new Multiset<String>());
trans.checkState();
assertTrue("An enabled transition is reported to be disabled", trans.isEnabled());
}
示例7: testCheckStateGuard
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testCheckStateGuard() throws ParameterException {
// Get a simple standard SNet and two of its transitions
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("tIn");
// create aGuardDataContainer
TestGuardDataContainer tgdc = new TestGuardDataContainer(sNet.getTokenColors());
// create two guards
NumberConstraint trueConstraint = new NumberConstraint("green", NumberOperator.IN_INTERVAL, -1, 1);
NumberConstraint falseConstraint = new NumberConstraint("green", NumberOperator.IN_INTERVAL, 2, 3);
// check state with true constraint
trans.setGuardDataContainer(tgdc);
trans.addGuard(trueConstraint);
trans.checkState();
assertTrue("An enabled transition is reported to be disabled", trans.isEnabled());
// check state with additional false constraint
trans.addGuard(falseConstraint);
trans.checkState();
assertFalse("An disabled transition is reported to be enabled", trans.isEnabled());
}
示例8: testSetAccessModeStringCollectionOfAccessMode
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testSetAccessModeStringCollectionOfAccessMode() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("tIn");
// set access mode
trans.setAccessMode("pink", AccessMode.READ, AccessMode.CREATE);
Map<String, Set<AccessMode>> modes = trans.getAccessModes();
Set<AccessMode> pinkAccess = modes.get("pink");
assertTrue("A given accessmode (READ) was not set.", pinkAccess.contains(AccessMode.READ));
assertTrue("A given accessmode (CREATE) was not set.", pinkAccess.contains(AccessMode.CREATE));
// Check there are no other modes
pinkAccess.remove(AccessMode.READ);
pinkAccess.remove(AccessMode.CREATE);
assertTrue("A non given accessmode was set.", pinkAccess.isEmpty());
}
示例9: testRemoveGuard
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testRemoveGuard() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("tIn");
// Get the gurads and check there are no guards initially
Set<AbstractConstraint<?>> guards = trans.getGuards();
assertTrue(guards.isEmpty());
// add a guard and make sure it is really there
trans.setGuardDataContainer(new TestGuardDataContainer(sNet.getTokenColors()));
NumberConstraint nc = new NumberConstraint("green", NumberOperator.LARGER, -3);
trans.addGuard(nc);
assertFalse(guards.isEmpty());
// remove it again
trans.removeGuard(nc);
assertTrue(guards.isEmpty());
}
示例10: testGetAccessModes
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testGetAccessModes() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("t0");
Map<String, Set<AccessMode>> modes = trans.getAccessModes();
// contained
Set<AccessMode> greenAccess = modes.get("green");
Set<AccessMode> redAccess = modes.get("red");
Set<AccessMode> blueAccess = modes.get("blue");
assertTrue("A given accessmode was not set.", greenAccess.contains(AccessMode.READ));
assertTrue("A given accessmode was not set.", redAccess.contains(AccessMode.DELETE));
assertTrue("A given accessmode was not set.", blueAccess.contains(AccessMode.CREATE));
}
示例11: testGetAccessModesString
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testGetAccessModesString() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("t0");
// contained
Set<AccessMode> greenAccess = trans.getAccessModes("green");
Set<AccessMode> redAccess = trans.getAccessModes("red");
Set<AccessMode> blueAccess = trans.getAccessModes("blue");
Set<AccessMode> pinkAccess = trans.getAccessModes("pink");
assertTrue("A given accessmode was not set.", greenAccess.contains(AccessMode.READ));
assertTrue("A given accessmode was not set.", redAccess.contains(AccessMode.DELETE));
assertTrue("A given accessmode was not set.", blueAccess.contains(AccessMode.CREATE));
assertTrue("A non given accessmode was set.", pinkAccess.isEmpty());
}
示例12: testAddAccessModeStringAccessModeArray
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testAddAccessModeStringAccessModeArray() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("t0");
HashSet<AccessMode> createMode = new HashSet<AccessMode>();
HashSet<AccessMode> deleteMode = new HashSet<AccessMode>();
createMode.add(AccessMode.CREATE);
deleteMode.add(AccessMode.DELETE);
trans.addAccessMode("green", createMode);
trans.addAccessMode("pink", deleteMode);
// Check all are contained
Set<AccessMode> greenModes = trans.getAccessModes("green");
assertTrue("An access mode is missing", greenModes.contains(AccessMode.CREATE));
assertTrue("An access mode is missing", greenModes.contains(AccessMode.READ));
Set<AccessMode> pinkModes = trans.getAccessModes("pink");
assertTrue("An access mode is missing", pinkModes.contains(AccessMode.DELETE));
}
示例13: testRemoveAccessModeStringAccessModeArray
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
@Test
public void testRemoveAccessModeStringAccessModeArray() throws ParameterException {
IFNet sNet = IFNetTestUtil.createSimpleIFNet();
RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("t0");
// remove a non existent access mode
assertFalse("Removing an non existent access mode returned true", trans.removeAccessMode("pink", AccessMode.READ));
// remove the read access
trans.removeAccessMode("green", AccessMode.READ);
Set<AccessMode> greenModes = trans.getAccessModes("green");
assertTrue("An access mode got not removed", greenModes.isEmpty());
// remove all access modes and then try to remove one more
trans.removeAccessModes("green");
trans.removeAccessModes("red");
trans.removeAccessModes("blue");
assertFalse("Removing an non existent access mode returned true", trans.removeAccessModes("green"));
}
示例14: IFNetInfoProvider
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
public IFNetInfoProvider(IFNet net) {
mTransitions = new ArrayList<String>();
Collection<AbstractIFNetTransition<IFNetFlowRelation>> transitions = net.getTransitions();
for (AbstractIFNetTransition<IFNetFlowRelation> transition : transitions) {
mTransitions.add(transition.getName() + "(" + transition.getLabel() + ")");
}
mPlaces = new ArrayList<String>();
mPlacesToColorMap = new HashMap<String, ArrayList<String>>();
Collection<IFNetPlace> places = net.getPlaces();
for (IFNetPlace p : places) {
mPlaces.add(p.getName() + "(" + p.getLabel() + ")");
ArrayList<String> possibleColors = new ArrayList<String>();
if(net.getInitialMarking().get(p.getName()) != null) {
possibleColors.addAll(net.getInitialMarking().get(p.getName()).support());
}
LinkedList<AbstractIFNetFlowRelation<?,?>> inRelations =
new LinkedList<AbstractIFNetFlowRelation<?,?>>(p.getIncomingRelations());
for (AbstractIFNetFlowRelation<?,?> inRel : inRelations) {
possibleColors.addAll(inRel.getConstraint().support());
}
mPlacesToColorMap.put(p.getName() + "(" + p.getLabel() + ")", possibleColors);
}
mSubjects = new ArrayList<String>(net.getSubjectDescriptors());
}
示例15: PatternController
import de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.IFNet; //导入依赖的package包/类
public PatternController(AnalysisController anaController) throws PatternException, Exception {
AbstractPatternFactory mPatternFactory = null;
mAnalysisController = anaController;
ViewComponent component = (ViewComponent) Workbench.getInstance().getTabView().getSelectedComponent();
if (component instanceof PTNetEditorComponent) {
mPatternFactory = new PTNetPatternFactory();
mModelInformationProvider = new PTNetInfoProvider((PTNet) ((PTNetEditorComponent) component).netContainer.getPetriNet());
} else if (component instanceof CPNEditorComponent) {
mPatternFactory = new CWNPatternFactory();
mModelInformationProvider = new CWNInfoProvider((CPN) ((CPNEditorComponent) component).netContainer.getPetriNet());
} else if (component instanceof IFNetEditorComponent) {
mPatternFactory = new IFNetPatternFactory();
mModelInformationProvider = new IFNetInfoProvider((IFNet) ((IFNetEditorComponent) component).netContainer.getPetriNet());
} else if (component instanceof LogFileViewer) {
mPatternFactory = new XESLogPatternFactory();
//mModelInformationProvider = new XESLogInfoProvider(((LogFileViewer) component).getFile());
mModelInformationProvider = new XESLogInfoProvider((LogFileViewer) component);
} else if (component instanceof LogViewViewer) {
mPatternFactory = new XESLogPatternFactory();
mModelInformationProvider = new XESLogInfoProvider((LogViewViewer) component);
}
mPatterns = mPatternFactory.loadPatterns();
for (CompliancePattern pattern : mPatterns) {
pattern.acceptInfoProfider(mModelInformationProvider);
}
generatePatternDialog();
}