HOG2
|
#include <RoboticArm.h>
Public Member Functions | |
ArmToTipHeuristic (RoboticArm *r) | |
virtual | ~ArmToTipHeuristic () |
double | HCost (const armAngles &node1, const armAngles &node2) const |
void | GenerateLegalStateTable (armAngles &legalArm) |
void | GenerateTipPositionTables (armAngles &sampleArm) |
void | GenerateRandomHeuristic (const armAngles &sampleArm) |
int | GenerateHeuristic (const armAngles &sampleArm, armAngles &goal) |
int | GenerateMaxDistHeuristics (const armAngles &sampleArm, const int numHeuristics) |
bool | ValidGoalPosition (double goalX, double goalY) |
Public Member Functions inherited from RoboticArmHeuristic | |
virtual | ~RoboticArmHeuristic () |
Private Member Functions | |
void | GenerateCPDB () |
uint64_t | ArmAnglesIndex (const armAngles &arm) const |
uint64_t | NumArmAnglesIndices (const armAngles &arm) const |
int | TipPositionIndex (const double x, const double y, const double minX, const double minY, const double width) const |
int | NumTipPositionIndices () const |
int | WriteArmAngles (FILE *file, armAngles &a) |
int | ReadArmAngles (FILE *file, armAngles &a) |
void | UpdateTipDistances (armAngles &arm, uint16_t distance, uint16_t *minTipDistances, uint16_t *maxTipDistances) |
int | GenerateHeuristicSub (const armAngles &sampleArm, const bool quiet, armAngles *goals, const int numGoals, uint16_t *distances, uint16_t *minTipDistances, uint16_t *maxTipDistances, armAngles &lastAdded) |
uint64_t | GenerateNextDepth (FILE *curFile, FILE *nextFile, uint16_t curDistance, uint16_t *distances, uint16_t *minTipDistances, uint16_t *maxTipDistances, armAngles &lastAdded) |
uint16_t | UseHeuristic (const armAngles &s, armAngles &g, uint16_t *distances) const |
uint16_t | UseHeuristic (const armAngles &arm, double goalX, double goalY, uint16_t *distances, uint16_t *minTipDistances, uint16_t *maxTipDistances) const |
Private Attributes | |
RoboticArm * | ra |
bool | m_TableComplete |
uint8_t * | legalStateTable |
uint8_t * | legalGoalTable |
std::vector< uint16_t * > | distancesTables |
std::vector< uint16_t * > | minTipDistancesTables |
std::vector< uint16_t * > | maxTipDistancesTables |
std::vector< uint16_t > | tablesNumArms |
std::vector< armAngles > * | tipPositionTables |
Definition at line 414 of file RoboticArm.h.
ArmToTipHeuristic::ArmToTipHeuristic | ( | RoboticArm * | r | ) |
Definition at line 600 of file RoboticArm.cpp.
References GenerateCPDB(), legalGoalTable, legalStateTable, m_TableComplete, ra, and tipPositionTables.
|
inlinevirtual |
Definition at line 417 of file RoboticArm.h.
|
private |
Definition at line 660 of file RoboticArm.cpp.
References armAngles::GetAngle(), and armAngles::GetNumArms().
Referenced by GenerateHeuristicSub(), GenerateLegalStateTable(), GenerateNextDepth(), and UseHeuristic().
|
private |
Definition at line 635 of file RoboticArm.cpp.
References RoboticArm::LegalArmConfig(), m_TableComplete, ra, armAngles::SetAngle(), and armAngles::SetNumArms().
Referenced by ArmToTipHeuristic().
Definition at line 937 of file RoboticArm.cpp.
References distancesTables, GenerateHeuristicSub(), armAngles::GetNumArms(), maxTipDistancesTables, minTipDistancesTables, NumArmAnglesIndices(), NumTipPositionIndices(), and tablesNumArms.
|
private |
Definition at line 794 of file RoboticArm.cpp.
References RoboticArm::ApplyAction(), ArmAnglesIndex(), GenerateNextDepth(), armAngles::GetAngle(), armAngles::GetNumArms(), RoboticArm::GoalTest(), kRotateCW, RoboticArm::LegalState(), NumArmAnglesIndices(), NumTipPositionIndices(), ra, armAngles::SetAngle(), armAngles::SetNumArms(), armRotations::SetRotation(), UpdateTipDistances(), and WriteArmAngles().
Referenced by GenerateHeuristic(), GenerateMaxDistHeuristics(), and GenerateRandomHeuristic().
void ArmToTipHeuristic::GenerateLegalStateTable | ( | armAngles & | legalArm | ) |
Definition at line 1115 of file RoboticArm.cpp.
References ArmAnglesIndex(), GenerateNextDepth(), legalGoalTable, legalStateTable, NumArmAnglesIndices(), NumTipPositionIndices(), UpdateTipDistances(), and WriteArmAngles().
int ArmToTipHeuristic::GenerateMaxDistHeuristics | ( | const armAngles & | sampleArm, |
const int | numHeuristics | ||
) |
Definition at line 965 of file RoboticArm.cpp.
References distancesTables, GenerateHeuristicSub(), armAngles::GetNumArms(), RoboticArm::GetTipPosition(), maxTipDistancesTables, minTipDistancesTables, NumArmAnglesIndices(), NumTipPositionIndices(), ra, armAngles::SetGoal(), and tablesNumArms.
|
private |
Definition at line 752 of file RoboticArm.cpp.
References RoboticArm::ApplyAction(), ArmAnglesIndex(), RoboticArm::GetActions(), ra, ReadArmAngles(), UpdateTipDistances(), and WriteArmAngles().
Referenced by GenerateHeuristicSub(), and GenerateLegalStateTable().
void ArmToTipHeuristic::GenerateRandomHeuristic | ( | const armAngles & | sampleArm | ) |
Definition at line 913 of file RoboticArm.cpp.
References distancesTables, GenerateHeuristicSub(), armAngles::GetNumArms(), maxTipDistancesTables, minTipDistancesTables, NumArmAnglesIndices(), NumTipPositionIndices(), armAngles::SetGoal(), and tablesNumArms.
void ArmToTipHeuristic::GenerateTipPositionTables | ( | armAngles & | sampleArm | ) |
Definition at line 1187 of file RoboticArm.cpp.
References RoboticArm::ApplyAction(), armAngles::GetAngle(), armAngles::GetNumArms(), RoboticArm::GetTipPosition(), kRotateCW, RoboticArm::LegalState(), NumTipPositionIndices(), ra, armAngles::SetAngle(), armAngles::SetNumArms(), armRotations::SetRotation(), TipPositionIndex(), and tipPositionTables.
Implements RoboticArmHeuristic.
Definition at line 610 of file RoboticArm.cpp.
References distancesTables, armAngles::GetGoal(), armAngles::GetNumArms(), maxTipDistancesTables, minTipDistancesTables, tablesNumArms, and UseHeuristic().
|
inlineprivate |
Definition at line 451 of file RoboticArm.h.
References armAngles::GetNumArms().
Referenced by GenerateHeuristic(), GenerateHeuristicSub(), GenerateLegalStateTable(), GenerateMaxDistHeuristics(), and GenerateRandomHeuristic().
|
inlineprivate |
Definition at line 459 of file RoboticArm.h.
References RoboticArm::GetTolerance(), and ra.
Referenced by GenerateHeuristic(), GenerateHeuristicSub(), GenerateLegalStateTable(), GenerateMaxDistHeuristics(), GenerateRandomHeuristic(), and GenerateTipPositionTables().
|
private |
Definition at line 708 of file RoboticArm.cpp.
References armAngles::GetNumArms(), armAngles::SetAngle(), and armAngles::SetNumArms().
Referenced by GenerateNextDepth().
|
private |
Definition at line 674 of file RoboticArm.cpp.
References RoboticArm::GetTolerance(), ra, and width.
Referenced by GenerateTipPositionTables(), UpdateTipDistances(), UseHeuristic(), and ValidGoalPosition().
|
private |
Definition at line 729 of file RoboticArm.cpp.
References RoboticArm::GetTipPosition(), ra, and TipPositionIndex().
Referenced by GenerateHeuristicSub(), GenerateLegalStateTable(), and GenerateNextDepth().
|
private |
Definition at line 1035 of file RoboticArm.cpp.
References ArmAnglesIndex(), RoboticArm::GetTolerance(), ra, and TipPositionIndex().
bool ArmToTipHeuristic::ValidGoalPosition | ( | double | goalX, |
double | goalY | ||
) |
Definition at line 1076 of file RoboticArm.cpp.
References RoboticArm::GetTolerance(), legalGoalTable, ra, and TipPositionIndex().
|
private |
Definition at line 690 of file RoboticArm.cpp.
References armAngles::GetAngle(), and armAngles::GetNumArms().
Referenced by GenerateHeuristicSub(), GenerateLegalStateTable(), and GenerateNextDepth().
|
private |
Definition at line 441 of file RoboticArm.h.
Referenced by GenerateHeuristic(), GenerateMaxDistHeuristics(), GenerateRandomHeuristic(), and HCost().
|
private |
Definition at line 439 of file RoboticArm.h.
Referenced by ArmToTipHeuristic(), GenerateLegalStateTable(), and ValidGoalPosition().
|
private |
Definition at line 438 of file RoboticArm.h.
Referenced by ArmToTipHeuristic(), and GenerateLegalStateTable().
|
private |
Definition at line 436 of file RoboticArm.h.
Referenced by ArmToTipHeuristic(), and GenerateCPDB().
|
private |
Definition at line 443 of file RoboticArm.h.
Referenced by GenerateHeuristic(), GenerateMaxDistHeuristics(), GenerateRandomHeuristic(), and HCost().
|
private |
Definition at line 442 of file RoboticArm.h.
Referenced by GenerateHeuristic(), GenerateMaxDistHeuristics(), GenerateRandomHeuristic(), and HCost().
|
private |
Definition at line 435 of file RoboticArm.h.
Referenced by ArmToTipHeuristic(), GenerateCPDB(), GenerateHeuristicSub(), GenerateMaxDistHeuristics(), GenerateNextDepth(), GenerateTipPositionTables(), NumTipPositionIndices(), TipPositionIndex(), UpdateTipDistances(), UseHeuristic(), and ValidGoalPosition().
|
private |
Definition at line 444 of file RoboticArm.h.
Referenced by GenerateHeuristic(), GenerateMaxDistHeuristics(), GenerateRandomHeuristic(), and HCost().
|
private |
Definition at line 446 of file RoboticArm.h.
Referenced by ArmToTipHeuristic(), and GenerateTipPositionTables().