UNPKG

pddl-workspace

Version:
134 lines (133 loc) 4.77 kB
import { FileInfo } from "./FileInfo"; import { PreProcessor } from "./PreProcessors"; import { PddlSyntaxTree } from "./parser/PddlSyntaxTree"; import { DocumentPositionResolver, PddlRange } from "./DocumentPositionResolver"; import { TypeObjectMap } from "./DomainInfo"; import { Constraint } from "./constraints"; import { PddlLanguage } from "./language"; import { URI } from "vscode-uri"; import { NumericExpression } from "./NumericExpression"; /** * Variable value initialization in the problem file. */ export declare class VariableValue { private variableName; private value; constructor(variableName: string, value: number | boolean); getVariableName(): string; getValue(): number | boolean; negate(): VariableValue; get isSupported(): boolean; } export declare class UnsupportedVariableValue extends VariableValue { constructor(text: string); negate(): VariableValue; get isSupported(): boolean; } /** * Supply-demand contract. */ export declare class SupplyDemand { private name; constructor(name: string); getName(): string; } export declare enum MetricDirection { MINIMIZE = 0, MAXIMIZE = 1 } export declare class Metric { private direction; private expression; private location; private documentation; constructor(direction: MetricDirection, expression: NumericExpression, location: PddlRange, documentation: string[]); getDirection(): MetricDirection; getExpression(): NumericExpression; getLocation(): PddlRange; getDocumentation(): string[]; } /** * Problem file. */ export declare class ProblemInfo extends FileInfo { readonly domainName: string; readonly syntaxTree: PddlSyntaxTree; private objects; private inits; private supplyDemands; private constraints; private metrics; private preParsingPreProcessor; constructor(fileUri: URI, version: number, problemName: string, domainName: string, syntaxTree: PddlSyntaxTree, positionResolver: DocumentPositionResolver); /** * Copy constructor for re-constructing the problem from a serialized form. * @param problem de-serialized problem * @param domainName domain name */ static clone(problem: ProblemInfo, domainName?: string): ProblemInfo; /** * Copy constructor for deriving problem file with new initial state (preserving TILs after the `newStateTime`). * @param origProblem original (de-serialized) problem * @param newState new initial state * @param newStateTime time at which the new state is effective */ static cloneWithInitStateAt(origProblem: ProblemInfo, newState: TimedVariableValue[], newStateTime?: number): string; setPreParsingPreProcessor(preProcessor: PreProcessor): void; getPreParsingPreProcessor(): PreProcessor | undefined; getLanguage(): PddlLanguage; setObjects(objects: TypeObjectMap): void; getObjects(type: string): string[]; getObjectsTypeMap(): TypeObjectMap; /** * Sets predicate/function initial values. * @param inits initial values */ setInits(inits: TimedVariableValue[]): void; /** * Returns variable initial values and time-initial literals/fluents. */ getInits(): TimedVariableValue[]; setSupplyDemands(supplyDemands: SupplyDemand[]): void; getSupplyDemands(): SupplyDemand[]; setConstraints(constraints: Constraint[]): void; getConstraints(): Constraint[]; setMetrics(metrics: Metric[]): void; getMetrics(): Metric[]; isProblem(): boolean; } /** * Variable value effective from certain time, e.g. initialization of the variable in the problem file. */ export declare class TimedVariableValue { private time; private variableName; private value; private _isSupported; constructor(time: number, variableName: string, value: number | boolean, _isSupported?: boolean); static from(time: number, value: VariableValue): TimedVariableValue; /** * Makes a deep copy of the supplied value and returns a new instance * @param value value to copy from */ static copy(value: TimedVariableValue): TimedVariableValue; get isSupported(): boolean; getTime(): number; setTime(time: number): void; getVariableName(): string; getLiftedVariableName(): string; getValue(): number | boolean; /** * Updates this value. * @param newValue new value */ update(time: number, newValue: VariableValue): void; /** * Determines whether the variable name and value are the same, ignoring the timestamp. * @param other other timed variable value */ sameValue(other: TimedVariableValue): boolean; getVariableValue(): VariableValue; toString(): string; toPddlString(): string; }