本文整理汇总了Java中de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition类的典型用法代码示例。如果您正苦于以下问题:Java AbstractTransition类的具体用法?Java AbstractTransition怎么用?Java AbstractTransition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractTransition类属于de.uni.freiburg.iig.telematik.sepia.petrinet.abstr包,在下文中一共展示了AbstractTransition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTransitionVars
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
private StringBuilder createTransitionVars() throws ParameterException {
StringBuilder transitionVarBuilder = new StringBuilder();
for (AbstractTransition<?,?> t : mAbstractNet.getTransitions()) {
transitionVarBuilder.append("//TransitionName: " + t.getName() + " "
+ "(TransitionLabel: " + t.getLabel() + ")" + "\n");
if(t instanceof DeclassificationTransition){
transitionVarBuilder.append("//Declassification Transition" + "\n");
} else {
transitionVarBuilder.append("//Regular Transition" + "\n");
}
//transitionVarBuilder.append(t.getName() + " : [0..1] init 0;" + "\n");
transitionVarBuilder.append(t.getName() + "_fired"+" : [0..1] init 0;" + "\n"+ "\n");
//remember last fired state
transitionVarBuilder.append(t.getName() + "_last"+" : [0..1] init 0;" + "\n"+ "\n");
}
int numberOfTransitions = TransitionToIDMapper.getTransitionCount();
transitionVarBuilder.append(transitionVarName + " : [0.." + numberOfTransitions + "] init 0;" + "\n");
return transitionVarBuilder;
}
示例2: parse
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
/**
* Parses the given file with the parser respective to the file extension.
*
* @param <P> Place type
* @param <T> Transition type
* @param <F> Flow relation type
* @param <M> Marking type
* @param <S> Node value type
* @param <N> Petri net type
* @param <G> Petri net graphics type
* @param file File to parse
* @return A {@link AbstractGraphicalPN}
* @throws IOException If the file can't be found or read
* @throws ParserException For exceptions caused by the parsing
*/
public static synchronized <P extends AbstractPlace<F, S>,
T extends AbstractTransition<F, S>,
F extends AbstractFlowRelation<P, T, S>,
M extends AbstractMarking<S>,
S extends Object,
N extends AbstractPetriNet<P, T, F, M, S>,
G extends AbstractPNGraphics<P, T, F, M, S>>
AbstractGraphicalPN<P, T, F, M, S, N, G>
parse(File file) throws IOException, ParserException {
validateFile(file);
PNParsingFormat format = guessFormat(file);
if (format == null) {
throw new ParserException(ErrorCode.UNKNOWN_FILE_EXTENSION);
}
PNParserInterface parser = getParser(file, format);
return parser.<P, T, F, M, S, N, G>parse(file);
}
示例3: getBoundedness
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
/**
* Checks if the Petri net is bounded.<br>
* In case the marking graph of the net cannot be constructed with the maximum number of elements (see {@link MGConstruction#MAX_RG_CALCULATION_STEPS}),<br>
* it is assumed to be unbounded; otherwise bounded.<br>
* @param generator The boundedness check generator.
* @return The marking graph of the given Petri net.
* @throws BoundednessException
*/
public static < P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object>
BoundednessCheckResult<P,T,F,M,S> getBoundedness(BoundednessCheckGenerator<P,T,F,M,S> generator) throws BoundednessException{
ThreadedBoundednessChecker<P,T,F,M,S> checker = new ThreadedBoundednessChecker<P,T,F,M,S>(generator);
checker.runCalculation();
BoundednessCheckResult<P,T,F,M,S> boundednessCheckResult = null;
try{
boundednessCheckResult = checker.getResult();
} catch (BoundednessException e) {
throw new BoundednessException("Exception during marking graph construction.\nReason: " + e.getMessage(), e);
}
return boundednessCheckResult;
}
示例4:
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static < P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object,
E extends LogEntry>
void
initiateOverlapCalculation( OverlapCallableGenerator<P,T,F,M,S,E> generator,
ExecutorListener<OverlapResult<E>> listener)
throws OverlapException {
ThreadedOverlapCalculator<P,T,F,M,S,E> calculator = new ThreadedOverlapCalculator<P,T,F,M,S,E>(generator);
calculator.addExecutorListener(listener);
calculator.runCalculation();
}
示例5: StringBuilder
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static < P extends AbstractPlace<F, S>,
T extends AbstractTransition<F, S>,
F extends AbstractFlowRelation<P, T, S>,
M extends AbstractMarking<S>,
S extends Object,
N extends AbstractPetriNet<P, T, F, M, S>,
G extends AbstractPNGraphics<P, T, F, M, S>>
String
serialize(AbstractGraphicalPN<P, T, F, M, S, N, G> net, PNSerializationFormat format) throws SerializationException {
Validate.notNull(net);
Validate.notNull(format);
StringBuilder builder = new StringBuilder();
builder.append(format.getFileFormat().getFileHeader());
builder.append(getSerializer(net, format).serialize());
builder.append(format.getFileFormat().getFileFooter());
return builder.toString();
}
示例6: getSerializer
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static < P extends AbstractPlace<F, S>,
T extends AbstractTransition<F, S>,
F extends AbstractFlowRelation<P, T, S>,
M extends AbstractMarking<S>,
S extends Object,
N extends AbstractPetriNet<P, T, F, M, S>,
G extends AbstractPNGraphics<P, T, F, M, S>>
void
serialize(AbstractGraphicalPN<P, T, F, M, S, N, G> net, PNSerializationFormat format, String path, String fileName) throws SerializationException, IOException {
Validate.notNull(net);
Validate.notNull(format);
PNSerializer<P, T, F, M, S, N, G> serializer = getSerializer(net, format);
serializer.serialize(path, fileName);
}
示例7: File
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static <P extends AbstractPlace<F, S>, T extends AbstractTransition<F, S>, F extends AbstractFlowRelation<P, T, S>, M extends AbstractMarking<S>, S extends Object, N extends AbstractPetriNet<P, T, F, M, S>, G extends AbstractPNGraphics<P, T, F, M, S>>
void
serialize(N net, PNSerializationFormat format, String path, String fileName) throws SerializationException, IOException {
Validate.notNull(net);
Validate.notNull(format);
Validate.notNull(path);
Validate.fileName(fileName);
// Check if path and file name are valid
File cPath = new File(path);
if (!cPath.exists())
cPath.mkdirs();
if (!cPath.isDirectory())
throw new IOException(path + " is not a valid path!");
if (fileName.isEmpty())
throw new ParameterException(ErrorCode.EMPTY);
PNSerializer<P, T, F, M, S, N, G> serializer = getSerializer(net, format);
serializer.serialize(path, fileName);
}
示例8:
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static < P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object,
E extends LogEntry>
void
initiateReplay( ReplayCallableGenerator<P,T,F,M,S,E> generator,
ExecutorListener<ReplayResult<E>> listener)
throws ReplayException {
ThreadedReplayer<P,T,F,M,S,E> calculator = new ThreadedReplayer<P,T,F,M,S,E>(generator);
calculator.addExecutorListener(listener);
calculator.runCalculation();
}
示例9: addTransitionCell
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
/**
* Inserts a new place with existing graphic information into the graphical
* Petri net.
*
* @param nodeName
* @param style
* @return
*/
@SuppressWarnings("rawtypes")
public PNGraphCell addTransitionCell(String nodeName, String style) {
AbstractTransition transition = getNetContainer().getPetriNet().getTransition(nodeName);
NodeGraphics nodeGraphics = getNetContainer().getPetriNetGraphics().getTransitionGraphics(nodeName);
AnnotationGraphics annotationGraphics = getNetContainer().getPetriNetGraphics().getTransitionLabelAnnotationGraphics(nodeName);
PNGraphCell newCell = createTransitionCell(transition.getName(), transition.getLabel(), nodeGraphics.getPosition().getX(), nodeGraphics.getPosition().getY(), nodeGraphics.getDimension()
.getX(), nodeGraphics.getDimension().getY(), style);
double offx = annotationGraphics.getOffset().getX();
double offy = annotationGraphics.getOffset().getY();
mxPoint offset = new mxPoint(offx, offy);
newCell.getGeometry().setOffset(offset);
// if (nodeGraphics == null || annotationGraphics == null) {
// mxCellState state = getView().getState(newCell, true);
// }
addCell(newCell, getDefaultParent());
return newCell;
}
示例10: createMap
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static void createMap(AbstractPetriNet<?,?,?,?,?> net) {
mTransToIDMap = new HashMap<String, Integer>();
Collection<AbstractTransition<?,?>> transitions =
(Collection<AbstractTransition<?, ?>>) net.getTransitions();
int counter = 0;
for (AbstractTransition<?,?> transition : transitions) {
mTransToIDMap.put(transition.getName(), ++counter);
}
}
示例11: fireAllEnabledTransitions
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
private boolean fireAllEnabledTransitions(AbstractGraphicalPN net, TimeMachine timeMachine,
PNTraverser<AbstractTransition<?, Object>> traverser) {
AbstractTransition<?, Object> transition = chooseTransition(traverser, net);
boolean didFire = false;
while (transition != null) {
try {
timeMachine.fire(transition.getName());
//System.out.println(this.getClass().getSimpleName() + ": fired " + transition.getName());
didFire = true;
} catch (PNException e) {
}
transition = chooseTransition(traverser, net);
}
return didFire;
}
示例12: parse
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
/**
* Parses the given file and returns a {@link AbstractGraphicalPN}.
*/
public <P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object,
N extends AbstractPetriNet<P, T, F, M, S>,
G extends AbstractPNGraphics<P, T, F, M, S>>
AbstractGraphicalPN<P, T, F, M, S, N, G> parse(File file) throws IOException, ParserException;
示例13: getAndToXorTransformer
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static <P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object>
PNTransformer<P,T,F,M,S>
getAndToXorTransformer(AbstractPetriNet<P,T,F,M,S> net, T andSplit, T andJoin) {
return new AndToXorTransformer<P,T,F,M,S>(net, andSplit, andJoin);
}
示例14: getXorToAndTransformer
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static <P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object>
PNTransformer<P,T,F,M,S>
getXorToAndTransformer(AbstractPetriNet<P,T,F,M,S> net, P xorSplit, P xorJoin) {
return new XorToAndTransformer<P,T,F,M,S>(net, xorSplit, xorJoin);
}
示例15: initiateDeadTransitionCheck
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition; //导入依赖的package包/类
public static < P extends AbstractPlace<F,S>,
T extends AbstractTransition<F,S>,
F extends AbstractFlowRelation<P,T,S>,
M extends AbstractMarking<S>,
S extends Object>
void initiateDeadTransitionCheck(DeadTransitionCheckCallableGenerator<P,T,F,M,S> generator, ExecutorListener<DeadTransitionCheckResult> listener)
throws DeadTransitionCheckException {
ThreadedDeadTransitionsChecker<P,T,F,M,S> calculator = new ThreadedDeadTransitionsChecker<P,T,F,M,S>(generator);
calculator.addExecutorListener(listener);
calculator.runCalculation();
}