当前位置: 首页>>代码示例>>Java>>正文


Java AbstractTransition类代码示例

本文整理汇总了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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:25,代码来源:PrismModelAdapter.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:33,代码来源:PNParsing.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:28,代码来源:BoundednessCheck.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:19,代码来源:Overlap.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:23,代码来源:PNSerialization.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:19,代码来源:PNSerialization.java

示例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);
	}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:25,代码来源:PNSerialization.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:19,代码来源:Replay.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:28,代码来源:PNGraph.java

示例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);
		}
	
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:12,代码来源:TransitionToIDMapper.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:16,代码来源:SimulateTimeAction.java

示例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;
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:13,代码来源:PNParserInterface.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:13,代码来源:PNTransformationFactory.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:13,代码来源:PNTransformationFactory.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:14,代码来源:DeadTransitionCheck.java


注:本文中的de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。