3 #ifndef GRAIL_ACTION_TEMPLATE_H
4 #define GRAIL_ACTION_TEMPLATE_H
17 using PreconditionFunction = std::function<bool(
const std::vector<const WorldObject*>&,
const WorldState&)>;
18 using EffectFunction = std::function<void(
const std::vector<WorldObject*>&, WorldState&)>;
19 using CostFunction = std::function<double(
const std::vector<const WorldObject*>&,
const WorldState&)>;
33 ActionTemplate(
const std::string& name,
const std::vector<unsigned int>& actionParameterTypes,
34 PreconditionFunction preconditionFunction, EffectFunction effectFunction, CostFunction costFunction);
38 int GetTypeId()
const;
39 const std::string& GetName()
const;
40 std::vector<class Action> GenerateActions(
const class WorldState& worldState)
const;
43 std::string name =
"";
44 std::vector<unsigned int> actionParameterTypes{};
45 PreconditionFunction preconditions = [](
const std::vector<const WorldObject*>&,
const WorldState&)
49 EffectFunction effects = [](
const std::vector<WorldObject*>&,
WorldState&)
52 CostFunction cost = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return 1.0; };
58 #endif // GRAIL_ACTION_TEMPLATE_H