UNPKG

ai-planning-val

Version:

Javascript/typescript wrapper for VAL (AI Planning plan validation and evaluation tools from KCL Planning department and the planning community around the ICAPS conference).

44 lines (43 loc) 2.15 kB
import { Variable, Plan, NumericExpression } from 'pddl-workspace'; import { GroundedFunctionValues, ValueSeqOptions } from './ValueSeq'; import { FunctionValues } from './PlanTimeSeriesParser'; export interface PlanFunctionEvaluatorOptions extends ValueSeqOptions { /** If set to true, functions are grouped by lifted function name */ shouldGroupByLifted?: boolean; /** ValStep path */ valStepPath?: string; } /** Evaluates numeric function values in the course of the plan. */ export declare class PlanFunctionEvaluator { private plan; private options?; private readonly grounder; private readonly problem; private readonly domain; private readonly allConstantsAndObjects; /** * Constructs * @param plan plan to evaluate * @param options options */ constructor(plan: Plan, options?: PlanFunctionEvaluatorOptions | undefined); /** * @returns `true` if the underlying utilities are available. */ isAvailable(): boolean; getValStepPath(): string | undefined; /** * Evaluates the functions individually, or in groups by lifted function. */ evaluate(): Promise<Map<Variable, GroundedFunctionValues>>; evaluateMetrics(): Promise<Map<string, FunctionValues>>; evaluateExpressionInputs(expression: NumericExpression): Promise<Map<string, FunctionValues>>; evaluateExpression(expression: NumericExpression): Promise<FunctionValues>; groupByLifted(variables: Variable[]): Map<Variable, Variable[]>; doNotGroupByLifted(variables: Variable[]): Map<Variable, Variable[]>; getChangingGroundedFunctions(): Promise<Variable[]>; getFunction(variableName: string): Variable | null; tryAddChartValues(domainFile: string, problemFile: string, planFile: string, liftedFunction: Variable, groundedFunctions: Variable[], chartData: Map<Variable, GroundedFunctionValues>): Promise<void>; addChartValues(domainFile: string, problemFile: string, planFile: string, liftedFunction: Variable, groundedFunctions: Variable[], chartData: Map<Variable, GroundedFunctionValues>): Promise<void>; ground(variable: Variable): Variable[]; }