@Test public void canCreateTransitionToPlace() { Transition transition = new DiscreteTransition("T0"); Place place = new DiscretePlace("P0"); assertFalse(creator.canCreate(transition, place)); }
@Override public <S extends Connectable, T extends Connectable> boolean canCreate(S source, T target) { ConnectableVisior connectableVisior = new ConnectableVisior(); try { source.accept(connectableVisior); boolean isSourcePlace = connectableVisior.isPlace; target.accept(connectableVisior); boolean isTargetTransition = connectableVisior.isTransition; return isSourcePlace && isTargetTransition; } catch (PetriNetComponentException e) { LOGGER.log(Level.INFO, e.toString()); return false; } }
InhibitorCreator implements ArcActionCreator { @Override public <S extends Connectable, T extends Connectable> boolean canCreate(S source, T target) { ConnectableVisior connectableVisior = new ConnectableVisior(); try { source.accept(connectableVisior); boolean isSourcePlace = connectableVisior.isPlace; target.accept(connectableVisior); boolean isTargetTransition = connectableVisior.isTransition; return isSourcePlace && isTargetTransition; } catch (PetriNetComponentException e) { LOGGER.log(Level.INFO, e.toString()); return false; } } }
InhibitorCreator implements ArcActionCreator { @Override public <S extends Connectable, T extends Connectable> boolean canCreate(S source, T target) { ConnectableVisior connectableVisior = new ConnectableVisior(); try { source.accept(connectableVisior); boolean isSourcePlace = connectableVisior.isPlace; target.accept(connectableVisior); boolean isTargetTransition = connectableVisior.isTransition; return isSourcePlace && isTargetTransition; } catch (PetriNetComponentException e) { LOGGER.log(Level.INFO, e.toString()); return false; } }  }
InhibitorCreator implements ArcActionCreator { @Override public <S extends Connectable, T extends Connectable> boolean canCreate(S source, T target) { ConnectableVisior connectableVisior = new ConnectableVisior(); try { source.accept(connectableVisior); boolean isSourcePlace = connectableVisior.isPlace; target.accept(connectableVisior); boolean isTargetTransition = connectableVisior.isTransition; return isSourcePlace && isTargetTransition; } catch (PetriNetComponentException e) { LOGGER.log(Level.INFO, e.toString()); return false; } }  @Override InboundArc createInboundArc(Place source, Transition target, List<ArcPoint> arcPoints); @Override OutboundArc createOutboundArc(Place target, Transition source, List<ArcPoint> arcPoints); @Override boolean canCreate(S source, T target); }
InhibitorCreator implements ArcActionCreator { @Override public <S extends Connectable, T extends Connectable> boolean canCreate(S source, T target) { ConnectableVisior connectableVisior = new ConnectableVisior(); try { source.accept(connectableVisior); boolean isSourcePlace = connectableVisior.isPlace; target.accept(connectableVisior); boolean isTargetTransition = connectableVisior.isTransition; return isSourcePlace && isTargetTransition; } catch (PetriNetComponentException e) { LOGGER.log(Level.INFO, e.toString()); return false; } }  @Override InboundArc createInboundArc(Place source, Transition target, List<ArcPoint> arcPoints); @Override OutboundArc createOutboundArc(Place target, Transition source, List<ArcPoint> arcPoints); @Override boolean canCreate(S source, T target);  }