AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
constraint_generator.h
1#ifndef PROBFD_OCCUPATION_MEASURES_CONSTRAINT_GENERATOR_H
2#define PROBFD_OCCUPATION_MEASURES_CONSTRAINT_GENERATOR_H
3
4#include "probfd/fdr_types.h"
5
6#include <iosfwd>
7#include <memory>
8
9// Forward Declarations
10class State;
11
12namespace lp {
13class LinearProgram;
14class LPSolver;
15} // namespace lp
16
17namespace probfd {
18class ProbabilisticTask;
19}
20
23
24class ConstraintGenerator {
25public:
26 virtual ~ConstraintGenerator() = default;
27
28 /*
29 Called upon initialization for the given task. Use this to add permanent
30 constraints and perform other initialization.
31 */
32 virtual void initialize_constraints(
33 const std::shared_ptr<ProbabilisticTask>& task,
34 const std::shared_ptr<FDRCostFunction>& task_cost_function,
35 lp::LinearProgram& lp) = 0;
36
37 /*
38 Called before evaluating a state. Use this to add temporary constraints
39 and to set bounds on permanent constraints for this state. All temporary
40 constraints are removed automatically after the evalution.
41 Returns true if a dead end was detected and false otherwise.
42 */
43 virtual void
44 update_constraints(const State& state, lp::LPSolver& solver) = 0;
45
46 /*
47 Called after evaluating a state. Use this to remove to unset bounds on
48 permanent constraints for this state.
49 */
50 virtual void
51 reset_constraints(const State& state, lp::LPSolver& solver) = 0;
52
53 virtual void print_statistics(std::ostream&) {}
54};
55
56} // namespace probfd::occupation_measures
57
58#endif // PROBFD_OCCUPATION_MEASURES_CONSTRAINT_GENERATOR_H
Namespace dedicated to occupation measure heuristic base classes.
Definition occupation_measure_heuristic.h:10
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8