Class CSTNU2CSTN
In other words, the CSTNU instance is transformed into a CSTN one and checked invoking CSTN.dynamicConsistencyCheck().
- Version:
- $Rev: 1154 $
- Author:
- Roberto Posenato
-
Nested Class Summary
Nested classes/interfaces inherited from class CSTNU
CSTNU.CSTNUCheckStatusModifier and TypeClassDescriptionstatic classA simple class to represent the status of the checking algorithm during an execution.Nested classes/interfaces inherited from class AbstractCSTN
AbstractCSTN.CheckAlgorithm, AbstractCSTN.CSTNCheckStatus, AbstractCSTN.DCSemantics, AbstractCSTN.EdgesToCheck<E>, AbstractCSTN.NodesToCheckModifier and TypeClassDescriptionstatic enumOnly for stating which kind of DC checking algorithms have been implemented so far.static classRepresents the status of a CSTN-checking algorithm during an execution.static enumValue for dcSemanticsstatic classAbstractCSTN.EdgesToCheck<E extends Edge>A simple class to maintain the set of edges to check in the following phase.static classActs as a queue and a set. -
Field Summary
FieldsFields inherited from class CSTNU
activationNode, contingentAlsoAsOrdinary, lowerContingentEdgeModifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2ObjectMap<LabeledNode, LabeledNode> Utility map that returns the activation time point (node) associated with a contingent link given the contingent time point, i.e., contingent link A ===> C determines the entry (C, A) in this map.(package private) booleanRepresent contingent links also as ordinary constraints.(package private) it.unimi.dsi.fastutil.objects.Object2ObjectMap<LabeledNode, CSTNUEdge> Utility map that returns the edge containing the lower-case constraint of a contingent link given the contingent time point.Fields inherited from class AbstractCSTN
checkStatus, cleanCheckedInstance, FILE_NAME_SUFFIX, fInput, fOutput, g, gCheckedCleaned, horizon, maxWeight, propagationOnlyToZ, reactionTime, timeOut, versionReq, withNodeLabels, ZERO_NODE_NAMEModifier and TypeFieldDescription(package private) AbstractCSTN.CSTNCheckStatusCheck status(package private) booleanIf true, after a check, the resulting graph is cleaned: all empty edges or labeled values containing unknown literals are removed.(package private) static StringSuffix for file name(package private) FileThe input file containing the CSTN graph in GraphML format.(package private) FileOutput file where to write the XML representing the CSTN graph after a check.(package private) TemporalConstraintGraph<CSTNUEdge> Input graph.(package private) TemporalConstraintGraph<CSTNUEdge> The graph obtained by a check and the cleaning action.(package private) intHorizon value.(package private) intThe absolute value of the max negative weight was determined during the initialization phase.(package private) booleanCheck using the full set of rules R0, qR0, R3, qR3, LP, qLP or the reduced set qR0, qR3, LP.(package private) intWD2.2 epsilon value, also called `reaction time` in ICAPS 18.(package private) intTimeout in seconds for the check.(package private) booleanSoftware Version.(package private) booleanIf false, node labels are ignored during the check.static final StringThe name for the initial node. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a CSTNU2CSTN with an empty graph using the sparse backend by default.CSTNU2CSTN(boolean useDenseGraph) Creates a CSTNU2CSTN with an empty, newly created graph.CSTNU2CSTN(TemporalConstraintGraph<CSTNUEdge> graph, int givenTimeOut) Constructor for CSTNU, without copying or converting the given graph. -
Method Summary
Modifier and TypeMethodDescriptionfinal CSTNU.CSTNUCheckStatusChecks the dynamic controllability (DC) of the given network (seeCSTNU(TemporalConstraintGraph)orAbstractCSTN.setG(TemporalConstraintGraph)).static void(package private) final TemporalConstraintGraph<CSTNEdge> Returns the corresponding CSTN of the given CSTNU g.Methods inherited from class CSTNU
checkAndManageIfNewLabeledValueIsANegativeLoop, checkWellDefinitionProperty1and3, dynamicConsistencyCheck, getCheckStatus, initAndCheck, isContingentAlsoAsOrdinary, labeledCrossLowerCaseRule, labelModificationqR0, labelModificationqR3, labelPropagation, lowerCaseValueAsString, mainConditionForRestrictedLP, mainConditionForSkippingInR0qR0, oneStepDynamicControllability, oneStepDynamicControllabilityLimitedToZ, reset, setContingentAlsoAsOrdinary, upperCaseValueAsString, zLabeledLetterRemovalRuleModifier and TypeMethodDescription(package private) static booleancheckAndManageIfNewLabeledValueIsANegativeLoop(int value, LabeledNode source, LabeledNode dest, BasicCSTNUEdge newEdge, AbstractCSTN.CSTNCheckStatus status) Just to check if a new labeled value is negative, its label has no unknown literals, and it is in a self-loop.(package private) booleancheckWellDefinitionProperty1and3(LabeledNode source, LabeledNode destination, CSTNUEdge e, boolean hasToBeFixed) Calls and then checks upper and lower case values.Checks the dynamic consistency (DC) of a CSTN instance within timeout seconds.final CSTNU.CSTNUCheckStatusGetter for the fieldcheckStatus, the status of a checking algorithm.voidChecks and initializes the CSTN instance represented by graphg.boolean(package private) booleanlabeledCrossLowerCaseRule(LabeledNode nA, LabeledNode nC, LabeledNode nX, CSTNUEdge eAC, CSTNUEdge eCX, CSTNUEdge eAX) Labeled Cross-Lower Case (zLc/CC)(package private) final booleanlabelModificationqR0(LabeledNode nObs, CSTNUEdge ePZ) Implements the zqR0 rule assuming instantaneous reaction and a streamlined network.(package private) final booleanlabelModificationqR3(LabeledNode nS, CSTNUEdge eSZ) Implements the qR3* rule assuming instantaneous reaction and a streamlined network.(package private) booleanlabelPropagation(LabeledNode nX, LabeledNode nY, LabeledNode nW, CSTNUEdge eXY, CSTNUEdge eYW, CSTNUEdge eXW) Applies 'labeled no case' and 'labeled upper case' and 'forward labeled upper case' and 'labeled conjunct upper case' rules.(package private) static StringlowerCaseValueAsString(ALabel nodeName, int value, Label label) static booleanmainConditionForRestrictedLP(int u, int ignoredV) IR Semantics(package private) final booleanIR Semantics Returns true ifAbstractCSTN.labelModificationR0qR0(LabeledNode, LabeledNode, E)method has to not apply.oneStepDynamicControllability(AbstractCSTN.EdgesToCheck<CSTNUEdge> edgesToCheck, Instant timeoutInstant) Executes one step of the dynamic controllability check.oneStepDynamicControllabilityLimitedToZ(AbstractCSTN.EdgesToCheck<CSTNUEdge> edgesToCheck, Instant timeoutInstant) Executes one step of the dynamic controllability check, considering only a pair of edges going to Z, i.e., in the form A-->B-->Z.voidreset()Resets all internal structuresfinal voidsetContingentAlsoAsOrdinary(boolean givenContingentAlsoAsOrdinary) Setter for the fieldcontingentAlsoAsOrdinary.(package private) static StringupperCaseValueAsString(ALabel nodeName, int value, Label label) (package private) final booleanLabeled LetterRemoval (zLr) and (zLr*)Methods inherited from class AbstractCSTN
addUpperBounds, checkWellDefinitionProperties, coreCSTNInitAndCheck, getCheckedGraph, getEdgeFromObserversToNode, getfOutput, getG, getGChecked, getGCheckedAsGraphML, getGraph, getMaxWeight, getReactionTime, getVersionAndCopyright, isOutputCleaned, isWithNodeLabels, labelModificationR0qR0, labelModificationR0qR0Core, mainConditionForSkippingInR3qR3, makeAlphaBetaGammaPrime4R3, makeAlphaPrime, makeBetaGammaDagger4qR3, makeNewEdge, manageParameters, newValueInR3qR3, pairAsString, recordCheckOutcome, removeChildrenOfUnknown, saveGraphToFile, setfOutput, setG, setOutputCleaned, setPropagationOnlyToZ, setWithNodeLabelsModifier and TypeMethodDescription(package private) final voidThe upper bounds from Z to each node have to be set after the horizon is determined.(package private) final booleancheckWellDefinitionProperties.(package private) final voidMakes the CSTN well-definedness check and initialization.final TemporalConstraintGraph<CSTNUEdge> Getter for the resulting checked graph, without copying or converting it.(package private) final it.unimi.dsi.fastutil.objects.ObjectList<CSTNUEdge> Determines the set of edges P?Getter for the fieldfOutput.getG()Deprecated.Deprecated.useAbstractCSTN.getCheckedGraph()in algorithms; this adapter is only for JUNG/GraphML boundaries.Helper method for having the graph obtained byAbstractCSTN.getCheckedGraph()in GraphML format.final TemporalConstraintGraph<CSTNUEdge> getGraph()Getter for the fieldg, the input graph, without copying or converting it.final intGetter for the fieldmaxWeight.final intGetter for the fieldreactionTime.final Stringbooleanboolean(package private) final booleanlabelModificationR0qR0(LabeledNode nObs, LabeledNode nX, CSTNUEdge eObsX) Applies rule R0/qR0: label containing a proposition that can be decided only in the future is simplified by removing such a proposition.(package private) final LabellabelModificationR0qR0Core(LabeledNode nP, LabeledNode nX, Label alpha, int w) Execute the core ofAbstractCSTN.labelModificationR0qR0(LabeledNode, LabeledNode, CSTNEdge).(package private) booleanmainConditionForSkippingInR3qR3(int w, LabeledNode nD) Returns true ifCSTN.labelModificationR3qR3(LabeledNode, LabeledNode, CSTNEdge)method has to not apply.(package private) final LabelmakeAlphaBetaGammaPrime4R3(LabeledNode nS, LabeledNode nD, LabeledNode nObs, char observed, Label labelFromObs, Label labelToClean) A simple method to determine the label "αβγ" for the ruleCSTN.labelModificationR3qR3(LabeledNode, LabeledNode, CSTNEdge).(package private) final LabelmakeAlphaPrime(LabeledNode nX, LabeledNode nObs, char observed, Label labelFromObs) Simple method to determine theα'to use in rules R0 and in rule qR0.(package private) final LabelmakeBetaGammaDagger4qR3(LabeledNode nS, LabeledNode nObs, char observed, Label labelFromObs, Label labelToClean) Simple method to determine the label (β*γ)† to use in rules qR3*CSTN.labelModificationR3qR3(LabeledNode, LabeledNode, CSTNEdge).(package private) final CSTNUEdgemakeNewEdge(String name, Edge.ConstraintType type) Create an edge, ensuring that its name is unique in the graph 'g'.(package private) final booleanmanageParameters(String[] args) Simple method to manage command line parameters using the "args4j" library.(package private) intnewValueInR3qR3(int edgeValue, int obsEdgeValue) Determines the new value that rules R3 and qR3 (see Table 1 in the ICAPS 2016 paper) must add.(package private) static StringpairAsString(Label label, int value) protected final voidrecordCheckOutcome(CheckOutcome.Kind kind, boolean successful) Records the verdict of a completed check on bothAbstractCSTN.gand, when it exists and is notgitself, onAbstractCSTN.gCheckedCleaned.(package private) final LabelReturns a new label removing all children of possibly present unknown literals inl.final voidHelper method to make it easier to store the resulting graph during a check.final voidsetfOutput(File fileOutput) final voidsetG(TemporalConstraintGraph<CSTNUEdge> graph) Considers the given graph as the graph to check, without copying or converting it (the graph will be modified).final voidsetOutputCleaned(boolean clean) Set to true for having the result graph cleaned of empty edges and labeled values having unknown literals.final voidsetPropagationOnlyToZ(boolean propagationOnlyToZ1) Setter for the fieldpropagationOnlyToZ.final voidsetWithNodeLabels(boolean withNodeLabels1)
-
Field Details
-
VERSIONandDATE
-
-
Constructor Details
-
CSTNU2CSTN
- Parameters:
graph- graph to check, without copying or converting it
-
CSTNU2CSTN
Constructor for CSTNU, without copying or converting the given graph.- Parameters:
graph- graph to checkgivenTimeOut- timeout for the check
-
CSTNU2CSTN
public CSTNU2CSTN()Creates a CSTNU2CSTN with an empty graph using the sparse backend by default. -
CSTNU2CSTN
public CSTNU2CSTN(boolean useDenseGraph) Creates a CSTNU2CSTN with an empty, newly created graph.- Parameters:
useDenseGraph- true to use the dense backend (DenseTCGraph); false to use the sparse backend (SparseTCGraph).
-
-
Method Details
-
main
-
dynamicControllabilityCheck
Checks the dynamic controllability (DC) of the given network (seeCSTNU(TemporalConstraintGraph)orAbstractCSTN.setG(TemporalConstraintGraph)).If the network is DC, it determines all the minimal ranges for the constraints.
During the execution of this method, the given network is modified.
If the check is successful, all constraints to node Z in the network are minimized; otherwise, the network contains at least one negative loop.
After a check,
AbstractCSTN.getCheckedGraph()returns the graph resulting from the check, andCSTNU.getCheckStatus()returns the result of the checking action with some statistics and the node with the negative loop if the network is NOT DC.In any case, before returning, this method calls
AbstractCSTN.saveGraphToFile()for saving the computed graph. Checks the controllability of a CSTNU instance. This method transforms the given CSTNU instance into a corresponding CSTN instance such that the original instance is dynamic controllable iff the corresponding CSTN is dynamic consistent.- Overrides:
dynamicControllabilityCheckin classCSTNU- Returns:
- an
CSTNU.CSTNUCheckStatusobject containing the final status and some statistics about the executed checking. - Throws:
WellDefinitionException- if any.
-
transform
Returns the corresponding CSTN of the given CSTNU g. The transformation consists of replacing each contingent link with a pattern that uses a proper new observation timepoint (associated with the contingent link).A ---(c:x, alpha) ---> C is transformed to A ---(x,alpha) ---> K? ---(0, alpha k) (y-x,alpha) ---> C <--- (C:-y, alpha)-- <---(-x,alpha)-- <---(0,alpha) (x-y,alpha¬k)--
- Returns:
- g represented as a CSTN, using the same concrete backend as g
-
AbstractCSTN.getGraph()in algorithms; this adapter is only for JUNG/GraphML boundaries.