Symphony 1.0
|
Represents an abstract problem that needs to be solved. More...
#include <definitions.h>
Public Member Functions | |
Problem () | |
Constructor for the Problem class. | |
virtual | ~Problem () |
Virtual destructor for the Problem class. | |
virtual State * | initial_state () |
Retrieves the initial state of the problem. | |
virtual bool | goal_test (State *state)=0 |
Tests if a given state satisfies the goal condition. | |
virtual std::vector< std::shared_ptr< Action > > | actions (std::shared_ptr< State > state)=0 |
Retrieves the set of actions applicable to a given state. | |
virtual double | heuristic (State *state)=0 |
Computes a heuristic estimate for a given state. | |
Public Attributes | |
State * | initial_state_ |
Pointer to the initial state of the problem. | |
Represents an abstract problem that needs to be solved.
This class defines the structure of a problem, including its initial state, goal test, actions, and heuristics. It should be extended by the user to implement specific problem-solving logic.
Definition at line 63 of file definitions.h.
|
inline |
|
inlinevirtual |
|
pure virtual |
Retrieves the set of actions applicable to a given state.
This method must be implemented by the user to define the available actions for a specific state.
state | The current state. |
Implemented in MazeProblem, StudyProblem, TaskScheduler, and VacuumCleaner.
Referenced by BreadthFirstSearch::search(), AStarSearch::search(), and BeamSearch::search().
|
pure virtual |
Tests if a given state satisfies the goal condition.
This method must be implemented by the user to define the goal state criteria.
state | The state to test. |
Implemented in MazeProblem, StudyProblem, TaskScheduler, and VacuumCleaner.
Referenced by BreadthFirstSearch::search(), AStarSearch::search(), and BeamSearch::search().
|
pure virtual |
Computes a heuristic estimate for a given state.
This method must be implemented by the user to define a heuristic function for the problem.
state | The state for which to compute the heuristic. |
Implemented in MazeProblem, StudyProblem, TaskScheduler, and VacuumCleaner.
Referenced by BreadthFirstSearch::search(), AStarSearch::search(), and BeamSearch::search().
|
inlinevirtual |
Retrieves the initial state of the problem.
Reimplemented in StudyProblem.
Definition at line 80 of file definitions.h.
References initial_state_.
Referenced by BreadthFirstSearch::search(), AStarSearch::search(), and BeamSearch::search().
State* Problem::initial_state_ |
Pointer to the initial state of the problem.
Definition at line 113 of file definitions.h.
Referenced by initial_state(), MazeProblem::MazeProblem(), TaskScheduler::TaskScheduler(), and VacuumCleaner::VacuumCleaner().