Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Action

Index

Constructors

constructor

  • new Action(name?: string, cost?: number): Action

Properties

_postConditions

_postConditions: Set<[string, boolean]> = new Set<[string, boolean]>()

_preConditions

_preConditions: Set<[string, boolean]> = new Set<[string, boolean]>()

cost

cost: number = 1

执行动作的成本。 改变它将会影响到计划期间的行动/选择。

name

name: string

Action的可选名称。用于调试目的

Methods

setPostcondition

  • setPostcondition(conditionName: string, value: boolean): void

setPrecondition

  • setPrecondition(conditionName: string, value: boolean): void

toString

  • toString(): string

validate

  • validate(): boolean
  • 在ActionPlanner进行plan之前调用。让Action有机会设置它的分数,或者在没有用的情况下选择退出。 例如,如果Action是要拿起一把枪,但世界上没有枪,返回false将使Action不被ActionPlanner考虑

    Returns boolean

Generated using TypeDoc