1 #ifndef GRAIL_ACTION_TEMPLATE_H
2 #define GRAIL_ACTION_TEMPLATE_H
15 using PreconditionFunction = std::function<bool(
const std::vector<const WorldObject*>&,
const WorldState&)>;
16 using EffectFunction = std::function<void(
const std::vector<WorldObject*>&, WorldState&)>;
17 using CostFunction = std::function<double(
const std::vector<const WorldObject*>&,
const WorldState&)>;
25 ActionTemplate(
const std::string& name,
const std::vector<unsigned int>& actionParameterTypes);
35 void SetEffects(EffectFunction effectFunction);
41 void SetTypeId(
int id);
42 int GetTypeId()
const;
43 const std::string& GetName()
const;
44 std::vector<class Action> GenerateActions(
const class WorldState& worldState)
const;
47 std::string name =
"";
48 std::vector<unsigned int> actionParameterTypes{};
49 PreconditionFunction preconditions = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return true; };
50 EffectFunction effects = [](
const std::vector<WorldObject*>&,
WorldState&) {};
51 CostFunction cost = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return 1.0; };
A class representing an action that can be simulated by grail planner.
Definition: ActionTemplate.hh:21
void SetPreconditions(PreconditionFunction preconditionFunction)
Definition: ActionTemplate.cpp:16
void SetEffects(EffectFunction effectFunction)
Definition: ActionTemplate.cpp:21
void SetCostFunction(CostFunction costFunction)
Definition: ActionTemplate.cpp:26
A class representing planner world state.
Definition: WorldState.hh:15