com.netgrif.application.engine.petrinet.domain.arcs.InhibitorArc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.petrinet.domain.arcs;
import com.netgrif.application.engine.petrinet.domain.Place;
/**
* If there is an arc a with a weight w=W(p,t) connecting a place p with a transition t,
* then t can be enabled in a marking m if the following condition is satisfied:
* m(p) < w
* More info
*/
public class InhibitorArc extends PTArc {
/**
* Returns true if source place has fewer tokens then arc weight.
*
* @return true if
* m(p) < w
* false otherwise.
*/
@Override
public boolean isExecutable() {
if (this.reference != null) multiplicity = this.reference.getMultiplicity();
return ((Place) source).getTokens() < multiplicity;
}
/**
* Does nothing. The token situation on p is not changed by the firing of t, i.e. m'(p) = m(p).
*/
@Override
public void execute() {
}
/**
* Does nothing. The token situation on p is not changed by the firing of t, i.e. m'(p) = m(p).
*/
@Override
public void rollbackExecution(Integer tokensConsumed) {
}
@SuppressWarnings("Duplicates")
@Override
public InhibitorArc clone() {
InhibitorArc clone = new InhibitorArc();
clone.setSourceId(this.sourceId);
clone.setDestinationId(this.destinationId);
clone.setMultiplicity(this.multiplicity);
clone.setObjectId(this.getObjectId());
clone.setImportId(this.importId);
clone.setReference(this.reference == null ? null : this.reference.clone());
return clone;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy