All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netgrif.application.engine.petrinet.domain.arcs.ResetArc Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.3.3
Show newest version
package com.netgrif.application.engine.petrinet.domain.arcs;

import com.netgrif.application.engine.petrinet.domain.Place;

/**
 * Reset arc does not alter the enabling condition, but involve a change of the marking on p by firing of t:
 * 
    *
  • m'(p) = 0, if p is not also a postplace of t
  • *
  • m'(p) = W(t,p), if p is also a postplace of t
  • *
* More info */ public class ResetArc extends PTArc { /** * Always returns true, because Reset arc does not alter the enabling condition. * * @return true */ @Override public boolean isExecutable() { return true; } /** * Changes the marking on p by firing of t: *
    *
  • m'(p) = 0, if p is not also a postplace of t
  • *
  • m'(p) = W(t,p), if p is also a postplace of t
  • *
*/ @Override public void execute() { Place place = ((Place) source); place.removeAllTokens(); } @Override public void rollbackExecution(Integer tokensConsumed) { ((Place) source).addTokens(tokensConsumed); } @SuppressWarnings("Duplicates") @Override public ResetArc clone() { ResetArc clone = new ResetArc(); clone.setSourceId(this.sourceId); clone.setDestinationId(this.destinationId); clone.setMultiplicity(this.multiplicity); clone.setObjectId(this.getObjectId()); clone.setImportId(this.importId); return clone; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy