本文整理匯總了Java中de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractPlace類的具體用法?Java AbstractPlace怎麽用?Java AbstractPlace使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractPlace類屬於de.uni.freiburg.iig.telematik.sepia.petrinet.abstr包,在下文中一共展示了AbstractPlace類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parse
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的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);
}
示例2: getBoundedness
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的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;
}
示例3: setColorCapacity
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的package包/類
public void setColorCapacity(String color, int value) {
Validate.notNull(color);
Validate.bigger(value, 0);
// Check if place already contains more tokens of the given color
// as the new capacity for this color.
if(getTokens(color) > value)
throw new ParameterException(ErrorCode.INCONSISTENCY, "Place already contains more tokens of color \""+color+"\" than the new capacity for this color.");
int oldCapacity = capacity;
if(colorCapacity.containsKey(color)){
capacity -= colorCapacity.get(color);
}
colorCapacity.put(color, value);
if(capacity == -1){
capacity = 0;
}
capacity += value;
if(capacity != oldCapacity)
placeListenerSupport.notifyCapacityChanged(new CapacityEvent<AbstractPlace<E,Multiset<String>>>(this, capacity));
}
示例4:
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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: addPlaceCell
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的package包/類
/**
* Inserts a new place with existing graphic information into the graphical
* Petri net.
*
* @param nodeName
* @param style
* @return
*/
@SuppressWarnings("rawtypes")
public PNGraphCell addPlaceCell(String nodeName, String style) {
AbstractPlace place = getNetContainer().getPetriNet().getPlace(nodeName);
NodeGraphics nodeGraphics = getNetContainer().getPetriNetGraphics().getPlaceGraphics(nodeName);
AnnotationGraphics annotationGraphics = getNetContainer().getPetriNetGraphics().getPlaceLabelAnnotationGraphics(nodeName);
PNGraphCell newCell = createPlaceCell(place.getName(), place.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: createTerminationLoops
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的package包/類
private StringBuilder createTerminationLoops() {
StringBuilder termLoopBuilder = new StringBuilder();
String enableCondition = "";
@SuppressWarnings("unchecked")
Iterator<AbstractPlace<?,?>> placeIter =
(Iterator<AbstractPlace<?, ?>>) mAbstractNet.getDrainPlaces().iterator();
// check whether output places contain a token
while(placeIter.hasNext()){
AbstractPlace<?,?> curPlace = placeIter.next();
if (placeIter.hasNext()) {
enableCondition += curPlace.getName() + "_black>=1 |";
} else {
enableCondition += curPlace.getName() + "_black>=1";
}
}
String loopEffect = " (" + transitionVarName + "'= 0)";
termLoopBuilder.append("[] ");
termLoopBuilder.append(enableCondition);
termLoopBuilder.append(" -> ");
termLoopBuilder.append(loopEffect);
termLoopBuilder.append(";\n\n");
return termLoopBuilder;
}
示例11: createPlaceVars
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的package包/類
@Override
protected StringBuilder createPlaceVars() {
StringBuilder allPlacesBuilder = new StringBuilder();
for (AbstractPlace<?,?> p : mAbstractNet.getPlaces()) {
StringBuilder placeBuilder = new StringBuilder();
placeBuilder.append("//PlaceName: " + p.getName() +" (PlaceLabel: " + p.getLabel() +")" + "\n");
if (mAbstractNet.getDrainPlaces().contains(p)) {
placeBuilder.append("//drainPlace" + "\n");
}
placeBuilder.append(p.getName() + "_black : ");
if (p.getCapacity() != -1) {
placeBuilder.append("[0.." + p.getCapacity() + "] ");
} else {
placeBuilder.append("int ");
//placeBuilder.append("[0..1024] ");
bounded = false;
}
if (mAbstractNet.getInitialMarking().get(p.getName()) != null) {
placeBuilder.append("init " + mAbstractNet.getInitialMarking().get(
p.getName()) + ";" + "\n");
} else {
placeBuilder.append("init 0;" + "\n");
}
allPlacesBuilder.append(placeBuilder.append("\n"));
}
return allPlacesBuilder;
}
示例12: parse
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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.AbstractPlace; //導入依賴的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();
}