Documentation ¶
Index ¶
- func ConditionSetToIntSlice(cs ConditionSet) []int
- func EffectsToIntSlice(cs []Effect) []int
- type Action
- func (o *Action) AdjustedCost(t CostType) int
- func (o *Action) DependsOn(n *Action) bool
- func (o *Action) IsPrivate() bool
- func (o *Action) IsPublic() bool
- func (o *Action) Name() string
- func (o *Action) Pre() []Condition
- func (o *Action) Prev() []Condition
- func (o *Action) Projection(vars []*Variable) *Action
- func (o *Action) String() string
- type ActionList
- func (ls ActionList) Copy() ActionList
- func (ls ActionList) Len() int
- func (ls ActionList) Less(i, j int) bool
- func (ls ActionList) Projection(vars []*Variable) ActionList
- func (ls ActionList) Satisfacted(cs []*Condition) (app, unapp ActionList)
- func (ls ActionList) String() string
- func (ls ActionList) Swap(i, j int)
- func (ls ActionList) WithCondition(c Condition) (res ActionList, rest ActionList)
- type ActionMap
- type Condition
- type ConditionSet
- func (cs ConditionSet) Add(c Condition) (ConditionSet, bool)
- func (cs ConditionSet) Consistent() bool
- func (cs ConditionSet) Equals(other ConditionSet) bool
- func (cs ConditionSet) Except(vs ...int) ConditionSet
- func (cs ConditionSet) Intersection(other ConditionSet) ConditionSet
- func (cs ConditionSet) Ints() []int
- func (cs ConditionSet) Ints32() []int32
- func (cs ConditionSet) IsSorted() bool
- func (q ConditionSet) Len() int
- func (q ConditionSet) Less(i, j int) bool
- func (cs ConditionSet) PrivateConditions(t *Task) ConditionSet
- func (cs ConditionSet) Projection(vars []*Variable) ConditionSet
- func (cs ConditionSet) PublicConditions(t *Task) ConditionSet
- func (cs ConditionSet) SubsetOf(other ConditionSet) bool
- func (q ConditionSet) Swap(i, j int)
- type CostType
- type Effect
- type MutexGroup
- type Task
- func (t *Task) AddAction(agentID int, o *Action)
- func (t *Task) GetAction(actionID int) *Action
- func (t *Task) GetActions() ActionList
- func (t *Task) GetPrivateVarIDs() []int
- func (t *Task) GetVarIDsF(p func(*Variable) bool) []int
- func (t *Task) GetVarsF(p func(*Variable) bool) []*Variable
- func (t *Task) PrintState(s VariableAssignment)
- func (t *Task) PrivateVars() []*Variable
- func (t *Task) PublicVars() []*Variable
- func (t *Task) SetAgentActions(agentID int, os ActionList)
- func (t *Task) ShallowCopy() *Task
- func (t *Task) String() string
- func (t *Task) VariableRanges() []int
- func (t *Task) Variables() []*Variable
- type Variable
- type VariableAssignment
- type VariableValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConditionSetToIntSlice ¶
func ConditionSetToIntSlice(cs ConditionSet) []int
func EffectsToIntSlice ¶
Types ¶
type Action ¶
type Action struct { ID int PDDLAction *pddl.Action Args []*pddl.Object Owner int Cost int Preconditions []Condition Effects []Effect Marked bool // TODO: needed? Private bool // contains filtered or unexported fields }
Action represents a grounded PDDL action
func (*Action) AdjustedCost ¶
AdjustedCost returns the action cost depending on the costType used.
func (*Action) DependsOn ¶
DependsOn determines if action o's preconditions and action n's effects have common variables.
func (*Action) Projection ¶
Projection returns the action projection keeping only variables from vars
type ActionList ¶
type ActionList []*Action
ActionList is an array of action objects, that supports some filtering methods and implements sort.Interface
func (ActionList) Copy ¶
func (ls ActionList) Copy() ActionList
Copy creates a copy of an ActionList
func (ActionList) Less ¶
func (ls ActionList) Less(i, j int) bool
Less returns true iff action at index i comes in lexicographic order before action at index j. TODO: fix slow down due to recomputation of o.String() method
func (ActionList) Projection ¶
func (ls ActionList) Projection(vars []*Variable) ActionList
Projection returns an ActionList containing all actions projections
func (ActionList) Satisfacted ¶
func (ls ActionList) Satisfacted(cs []*Condition) (app, unapp ActionList)
Satisfacted returns two ActionLists. The first contains all actions of which all preconditions exist in the condition set cs, the second contains those actions where this is not the case.
func (ActionList) String ¶
func (ls ActionList) String() string
String returns a string representation of an ActionList
func (ActionList) Swap ¶
func (ls ActionList) Swap(i, j int)
func (ActionList) WithCondition ¶
func (ls ActionList) WithCondition(c Condition) (res ActionList, rest ActionList)
WithCondition returns all actions in ActionList that contain condition c in their precondition and those who don't as two separate lists.
type ActionMap ¶
type ActionMap map[int]ActionList
ActionMap contains each agents list of actions (keys are agentIDs)
func (ActionMap) Actions ¶
func (aom ActionMap) Actions() ActionList
type Condition ¶
type Condition VariableValuePair
Condition is a (variable,value) pair used in action preconditions
type ConditionSet ¶
type ConditionSet []Condition
ConditionSet is a list of Conditions with set-like behaviour
func CreateConditionSet ¶
func CreateConditionSet(a []int) ConditionSet
func (ConditionSet) Add ¶
func (cs ConditionSet) Add(c Condition) (ConditionSet, bool)
Add adds a condition to ConditionSet cs if it is not already contained in cs and returns the resulting set
func (ConditionSet) Consistent ¶
func (cs ConditionSet) Consistent() bool
Consistent returns true iff no two conditions refer to the same variable
func (ConditionSet) Equals ¶
func (cs ConditionSet) Equals(other ConditionSet) bool
Equal returns true iff two conditionsets are structurally equal
func (ConditionSet) Except ¶
func (cs ConditionSet) Except(vs ...int) ConditionSet
func (ConditionSet) Intersection ¶
func (cs ConditionSet) Intersection(other ConditionSet) ConditionSet
Intersection returns the intersection of two ConditionSets
func (ConditionSet) Ints ¶
func (cs ConditionSet) Ints() []int
func (ConditionSet) Ints32 ¶
func (cs ConditionSet) Ints32() []int32
func (ConditionSet) IsSorted ¶
func (cs ConditionSet) IsSorted() bool
func (ConditionSet) Less ¶
func (q ConditionSet) Less(i, j int) bool
func (ConditionSet) PrivateConditions ¶
func (cs ConditionSet) PrivateConditions(t *Task) ConditionSet
TODO: these methods are obsolete due to Project-method above
func (ConditionSet) Projection ¶
func (cs ConditionSet) Projection(vars []*Variable) ConditionSet
Projection returns the ConditionSet that only contains variables from vars
func (ConditionSet) PublicConditions ¶
func (cs ConditionSet) PublicConditions(t *Task) ConditionSet
func (ConditionSet) SubsetOf ¶
func (cs ConditionSet) SubsetOf(other ConditionSet) bool
SubsetOf checks whether all conditions of a ConditionSet are contained in another ConditionSet TODO: rename Subsumes (referring to partial state subsumption in sas+) Complexity: O(n), where n = max{len(other), len(cs)}
func (ConditionSet) Swap ¶
func (q ConditionSet) Swap(i, j int)
type CostType ¶
type CostType byte // TODO: rename to ActionCostType
CostType specifies actions cost type (e.g. Normal vs Unit)
type Effect ¶
type Effect VariableValuePair
Effect is a (variable,value) pair used in action effects TODO: when conditional effects are implemented, Effect should become an interface and the concrete types should be named atomicEffect and conditionalEffect, both implementing the Effect interface
func CreateEffects ¶
type MutexGroup ¶
type MutexGroup []*VariableValuePair
MutexGroup is a list of Variable-Value Pairs
func (MutexGroup) String ¶
func (mg MutexGroup) String() string
type Task ¶
type Task struct { AgentID int Vars []*Variable Init state.State Goal ConditionSet Actions ActionMap ActionsByID map[int]*Action MutexGroups []MutexGroup // [Variable.ID]MutexGroup // contains filtered or unexported fields }
Task contains all the information of a planning task.
func NewTaskFromFile ¶
NewTaskFromFile reads a problem file and returns the corresponding planning Task if the file format (e.g. .json) is supported
func NewTaskFromJSON ¶
NewTaskFromJSON converts a byte-slice of the supported json format into the corresponding planning Task representation
func (*Task) GetActions ¶
func (t *Task) GetActions() ActionList
func (*Task) GetPrivateVarIDs ¶
GetPrivateVarIDs returns the list of IDs of private variables
func (*Task) GetVarIDsF ¶
GetVarIDsF returns the list of IDs of variables for which p returns true
func (*Task) PrivateVars ¶
PrivateVars returns the list of variables that are private
func (*Task) PublicVars ¶
PublicVars returns the list of variables that are public
func (*Task) SetAgentActions ¶
func (t *Task) SetAgentActions(agentID int, os ActionList)
func (*Task) ShallowCopy ¶
func (*Task) VariableRanges ¶
VariableRanges returns the domainSize/range of each variable in a vector. Index corresponds to variable.ID
type VariableAssignment ¶
type VariableAssignment []int
VariableAssignment is a value assignment over all variables. The index corresponds to the variable ID, the value is the assigned value.
type VariableValuePair ¶
VariableValuePair contains a variable ID (int) and an intended value (byte)