3 #ifndef GRAIL_ACTION_TEMPLATE_H
4 #define GRAIL_ACTION_TEMPLATE_H
20 using PreconditionFunction = std::function<bool(
const std::vector<const WorldObject*>&,
const WorldState&)>;
25 using EffectFunction = std::function<void(
const std::vector<WorldObject*>&, WorldState&)>;
30 using CostFunction = std::function<double(
const std::vector<const WorldObject*>&,
const WorldState&)>;
45 ActionTemplate(
const std::string& name,
const std::vector<unsigned int>& actionParameterTypes,
46 PreconditionFunction preconditionFunction, EffectFunction effectFunction, CostFunction costFunction);
60 const std::string&
GetName()
const;
70 std::string name =
"";
71 std::vector<unsigned int> actionParameterTypes{};
72 PreconditionFunction preconditions = [](
const std::vector<const WorldObject*>&,
const WorldState&)
76 EffectFunction effects = [](
const std::vector<WorldObject*>&,
WorldState&)
79 CostFunction cost = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return 1.0; };
85 #endif // GRAIL_ACTION_TEMPLATE_H