HOG2
GraphRefinementEnvironment.h
Go to the documentation of this file.
1 /*
2  * GraphRefinementEnvironment.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 4/15/10.
6  * Copyright 2010 NS Software. All rights reserved.
7  *
8  */
9 
10 #ifndef GRAPHREFINEMENTENVIRONMENT_H
11 #define GRAPHREFINEMENTENVIRONMENT_H
12 
13 #include <stdint.h>
14 #include <unordered_map>
15 #include <iostream>
16 #include "GraphEnvironment.h"
17 #include "GraphAbstraction.h"
18 
20 {
21 public:
24 
25 // void SetPlanningLevel(int planLevel);
26 // int GetPlanningLevel();
27 
28  virtual void GetSuccessors(const graphState &stateID, std::vector<graphState> &neighbors) const;
29  virtual void GetActions(const graphState &stateID, std::vector<graphMove> &actions) const;
30  virtual bool GoalTest(const graphState &state, const graphState &goal) const;
31  virtual bool GoalTest(const graphState &) const { assert(false); return false; }
32  virtual void SetUseAbstractGoal(bool use, int level) { useAbstractGoal = use; abstractGoalLevel = level; }
33  //void SetPlanningCorridor(std::vector<graphState> &corridor, int level);
34  void SetPlanningCorridor(std::vector<graphState> &corridor, int level, int start = 0);
35  double HCost(const graphState &state1, const graphState &state2) const;
36  double HCost(const graphState &) const { assert(false); return false; }
37 private:
39  typedef std::unordered_map<graphState, bool> CorridorCheck;
43 };
44 
45 #endif
GraphRefinementEnvironment::CorridorCheck
std::unordered_map< graphState, bool > CorridorCheck
Definition: GraphRefinementEnvironment.h:39
GraphAbstraction
A generic class for basic operations on Graph abstractions.
Definition: GraphAbstraction.h:63
GraphRefinementEnvironment::corridorLevel
int corridorLevel
Definition: GraphRefinementEnvironment.h:40
GraphRefinementEnvironment::ga
GraphAbstraction * ga
Definition: GraphRefinementEnvironment.h:38
graphState
unsigned long graphState
Definition: GraphEnvironment.h:32
GraphRefinementEnvironment::HCost
double HCost(const graphState &state1, const graphState &state2) const
Heuristic value between two arbitrary nodes.
Definition: GraphRefinementEnvironment.cpp:83
GraphRefinementEnvironment::GraphRefinementEnvironment
GraphRefinementEnvironment(GraphAbstraction *ga, int planLevel, GraphHeuristic *gh, Map *m=0)
Definition: GraphRefinementEnvironment.cpp:16
GraphEnvironment::m
Map * m
Definition: GraphEnvironment.h:359
GraphRefinementEnvironment::GetSuccessors
virtual void GetSuccessors(const graphState &stateID, std::vector< graphState > &neighbors) const
Definition: GraphRefinementEnvironment.cpp:37
GraphRefinementEnvironment::planLevel
int planLevel
Definition: GraphRefinementEnvironment.h:40
GraphRefinementEnvironment::corridorTable
CorridorCheck corridorTable
Definition: GraphRefinementEnvironment.h:42
GraphRefinementEnvironment::HCost
double HCost(const graphState &) const
Heuristic value between node and the stored goal.
Definition: GraphRefinementEnvironment.h:36
GraphRefinementEnvironment::GetActions
virtual void GetActions(const graphState &stateID, std::vector< graphMove > &actions) const
Definition: GraphRefinementEnvironment.cpp:60
GraphRefinementEnvironment::~GraphRefinementEnvironment
~GraphRefinementEnvironment()
Definition: GraphRefinementEnvironment.cpp:25
GraphRefinementEnvironment
Definition: GraphRefinementEnvironment.h:19
GraphRefinementEnvironment::SetPlanningCorridor
void SetPlanningCorridor(std::vector< graphState > &corridor, int level, int start=0)
Definition: GraphRefinementEnvironment.cpp:75
GraphRefinementEnvironment::useAbstractGoal
bool useAbstractGoal
Definition: GraphRefinementEnvironment.h:41
GraphRefinementEnvironment::GoalTest
virtual bool GoalTest(const graphState &) const
Goal Test if the goal is stored.
Definition: GraphRefinementEnvironment.h:31
GraphRefinementEnvironment::GoalTest
virtual bool GoalTest(const graphState &state, const graphState &goal) const
Definition: GraphRefinementEnvironment.cpp:66
GraphRefinementEnvironment::SetUseAbstractGoal
virtual void SetUseAbstractGoal(bool use, int level)
Definition: GraphRefinementEnvironment.h:32
GraphRefinementEnvironment::abstractGoalLevel
int abstractGoalLevel
Definition: GraphRefinementEnvironment.h:40
GraphEnvironment
Definition: GraphEnvironment.h:291
Map
A tile-based representation of the world.
Definition: Map.h:142
GraphAbstraction.h
GraphHeuristic
Definition: GraphEnvironment.h:77
GraphEnvironment.h