Class CSTN2CSTN0
- Version:
- $Rev: 1154 $
- Author:
- Roberto Posenato
-
Nested Class Summary
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 CSTNEpsilon
epsilonFields 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<CSTNEdge> Input graph.(package private) TemporalConstraintGraph<CSTNEdge> 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 CSTN2CSTN0 with an empty graph using the sparse backend by default.CSTN2CSTN0(boolean useDenseGraph) Creates a CSTN2CSTN0 with an empty, newly created graph.CSTN2CSTN0(int givenReactionTime, TemporalConstraintGraph<CSTNEdge> graph) CSTN2CSTN0(int givenReactionTime, TemporalConstraintGraph<CSTNEdge> graph, int givenTimeOut) -
Method Summary
Modifier and TypeMethodDescriptionChecks the dynamic consistency (DC) of a CSTN instance within timeout seconds.static void(package private) final TemporalConstraintGraph<CSTNEdge> Returns the corresponding CSTN having each observation node 'P?'Methods inherited from class CSTNEpsilon
getEpsilonReactionTime, lpMustRestricted2ConsistentLabel, mainConditionForSkippingInR0qR0, mainConditionForSkippingInR3qR3, newValueInR3qR3Modifier and TypeMethodDescriptionfinal int(package private) booleanlpMustRestricted2ConsistentLabel(int u, int v) Returns true if label propagation rule (for example,CSTN.labelPropagation(LabeledNode, LabeledNode, LabeledNode, CSTNEdge, CSTNEdge, CSTNEdge)method) has to apply only for consistent labels.(package private) final booleanReturns true ifAbstractCSTN.labelModificationR0qR0(LabeledNode, LabeledNode, E)method has to not apply.(package private) final booleanmainConditionForSkippingInR3qR3(int w, LabeledNode nD) Returns true ifCSTN.labelModificationR3qR3(LabeledNode, LabeledNode, CSTNEdge)method has to not apply.(package private) final intnewValueInR3qR3(int edgeValue, int obsEdgeValue) According to Table 2 paper ICAPS16, it returnsmax(edgeValue, obsEdgeValue-ɛ).Methods inherited from class CSTN
defaultMain, dynamicConsistencyCheckWOInit, labelModificationR3qR3, labelPropagation, oneStepDynamicConsistencyByEdges, oneStepDynamicConsistencyByEdgesLimitedToZ, oneStepDynamicConsistencyByNodeModifier and TypeMethodDescription(package private) static voiddefaultMain(String[] args, CSTN cstn, String kindOfChecking) (package private) AbstractCSTN.CSTNCheckStatusChecks the dynamic consistency of a CSTN instance without initializing the network.(package private) booleanlabelModificationR3qR3(LabeledNode nS, LabeledNode nD, CSTNEdge eSD) Rule R3*(package private) booleanlabelPropagation(LabeledNode nA, LabeledNode nB, LabeledNode nC, CSTNEdge eAB, CSTNEdge eBC, CSTNEdge eAC) Applies the labeled propagation rule:(package private) AbstractCSTN.CSTNCheckStatusoneStepDynamicConsistencyByEdges(AbstractCSTN.EdgesToCheck<CSTNEdge> edgesToCheck, Instant timeoutInstant) Executes one step of the dynamic consistency check.(package private) AbstractCSTN.CSTNCheckStatusoneStepDynamicConsistencyByEdgesLimitedToZ(AbstractCSTN.EdgesToCheck<CSTNEdge> edgesToCheck, Instant timeoutInstant) Executes one step of the dynamic consistency check.Executes one step of the dynamic consistency check.Methods inherited from class AbstractCSTN
addUpperBounds, checkWellDefinitionProperties, checkWellDefinitionProperty1and3, coreCSTNInitAndCheck, getCheckedGraph, getCheckStatus, getEdgeFromObserversToNode, getfOutput, getG, getGChecked, getGCheckedAsGraphML, getGraph, getMaxWeight, getReactionTime, getVersionAndCopyright, initAndCheck, isOutputCleaned, isWithNodeLabels, labelModificationR0qR0, labelModificationR0qR0Core, makeAlphaBetaGammaPrime4R3, makeAlphaPrime, makeBetaGammaDagger4qR3, makeNewEdge, manageParameters, pairAsString, recordCheckOutcome, removeChildrenOfUnknown, reset, 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) booleancheckWellDefinitionProperty1and3(LabeledNode nS, LabeledNode nD, CSTNEdge eSN, boolean hasToBeFixed) Checks whether the constraint represented by an edge 'e' satisfies the well-defined first property (WD1): any labeled value of the edge has a label that subsumes both labels of the two endpoints. In case a label is not WD1 andhasToBeFixed, then it is fixed.(package private) final voidMakes the CSTN well-definedness check and initialization.final TemporalConstraintGraph<CSTNEdge> Getter for the resulting checked graph, without copying or converting it.Getter for the fieldcheckStatus, the status of a checking algorithm.(package private) final it.unimi.dsi.fastutil.objects.ObjectList<CSTNEdge> 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<CSTNEdge> getGraph()Getter for the fieldg, the input graph, without copying or converting it.final intGetter for the fieldmaxWeight.final intGetter for the fieldreactionTime.final StringvoidChecks and initializes the CSTN instance represented by graphg.booleanboolean(package private) final booleanlabelModificationR0qR0(LabeledNode nObs, LabeledNode nX, CSTNEdge 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) 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 CSTNEdgemakeNewEdge(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) 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.voidreset()Resets all internal structures but not g.final voidHelper method to make it easier to store the resulting graph during a check.final voidsetfOutput(File fileOutput) final voidsetG(TemporalConstraintGraph<CSTNEdge> 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
-
CSTN2CSTN0
- Parameters:
givenReactionTime- the reaction time of the networkgraph- graph to check, without copying or converting it
-
CSTN2CSTN0
- Parameters:
givenReactionTime- the reaction time of the network.graph- graph to check, without copying or converting itgivenTimeOut- the timeout for the check in seconds.
-
CSTN2CSTN0
public CSTN2CSTN0()Creates a CSTN2CSTN0 with an empty graph using the sparse backend by default. -
CSTN2CSTN0
public CSTN2CSTN0(boolean useDenseGraph) Creates a CSTN2CSTN0 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
public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException - Parameters:
args- an array ofStringobjects.- Throws:
IOException- if any.ParserConfigurationException- if any.SAXException- if any.
-
dynamicConsistencyCheck
Checks the dynamic consistency (DC) of a CSTN instance within timeout seconds. 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.getGChecked()returns the network determined by the check andAbstractCSTN.getCheckStatus()the result of the checking action with some statistics, and the node having a negative loop if the network is NOT DC.In any case, before returning, this method call
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:
dynamicConsistencyCheckin classCSTN- Returns:
- the final status of the checking with some statistics.
- Throws:
WellDefinitionException- if any.
-
transform
Returns the corresponding CSTN having each observation node 'P?' replaced with a pair of nodes 'P?' and 'P?0'. 'P?' is the standard node, while 'P?0' is a new observation node that observes 'p'.'P?0' is set to be at distance epsilon after 'P?', exactly.
- Returns:
- g represented as a CSTN0. To minimize name conflicts, the new name associated with 'P?' is 'P?^0'.
-
AbstractCSTN.getGraph()in algorithms; this adapter is only for JUNG/GraphML boundaries.