assignment1
Class CMapDomain

java.lang.Object
  extended by assignment1.CMapDomain
All Implemented Interfaces:
IDomain

public class CMapDomain
extends java.lang.Object
implements IDomain


Constructor Summary
CMapDomain()
           
 
Method Summary
 double ActionCost(IState arg_state, CPair<IAction,IState> arg_pair)
           
protected static int ConvertDirection(assignment1.CMapDomain.Direction arg_direction)
           
 assignment1.CMapDomain.CState GetInitialState()
           
protected  double H_Manhattan(assignment1.CMapDomain.CState arg_state, CPair<java.lang.Integer,java.lang.Integer> arg_Goal)
          Manhattan distance, with respect paid towards the cost of turning
protected  double H_StraightLine(assignment1.CMapDomain.CState arg_state, CPair<java.lang.Integer,java.lang.Integer> arg_Goal)
          Straight line distance
 double H(IState arg_state)
          A heuristic function used for something like A* search.
 boolean IsGoal(IState arg_state)
           
protected  assignment1.CMapDomain.Direction MapDirection(java.lang.Integer arg_int)
           
 void ParseMap(java.lang.String arg_FileName)
           
 double PathCost(java.util.Vector<IState> arg_Path)
           
 void Serialize(java.io.OutputStream arg_outputstream)
           
 java.util.Vector<CPair<IAction,IState>> SuccessorFN(IState arg_state)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CMapDomain

public CMapDomain()
Method Detail

ParseMap

public void ParseMap(java.lang.String arg_FileName)

MapDirection

protected assignment1.CMapDomain.Direction MapDirection(java.lang.Integer arg_int)

GetInitialState

public assignment1.CMapDomain.CState GetInitialState()
Specified by:
GetInitialState in interface IDomain
Returns:
an IState value

PathCost

public double PathCost(java.util.Vector<IState> arg_Path)
Specified by:
PathCost in interface IDomain

ActionCost

public double ActionCost(IState arg_state,
                         CPair<IAction,IState> arg_pair)
Specified by:
ActionCost in interface IDomain
Parameters:
arg_state - an IState, the current state
Returns:
a double, the state that one gets to from current state via the given action

SuccessorFN

public java.util.Vector<CPair<IAction,IState>> SuccessorFN(IState arg_state)
Specified by:
SuccessorFN in interface IDomain
Parameters:
arg_state - and IState value
Returns:
a Vector of CNodes, representing the possible successor states

IsGoal

public boolean IsGoal(IState arg_state)
Specified by:
IsGoal in interface IDomain
Parameters:
arg_state - an IState value
Returns:
a boolean value, true iff the given state is a goal of this problem

H

public double H(IState arg_state)
Description copied from interface: IDomain
A heuristic function used for something like A* search. Remember that the hueristic is constrained to be no more than the true distance/cost to a goal, but has no contraint as to being dynamic. That is, a constant value of 1 is allowable (just not useful).

Specified by:
H in interface IDomain
Parameters:
arg_state - an IState value
Returns:
a double value, a guess at how far away a goal state is from arg_state.

H_StraightLine

protected double H_StraightLine(assignment1.CMapDomain.CState arg_state,
                                CPair<java.lang.Integer,java.lang.Integer> arg_Goal)
Straight line distance

Parameters:
arg_state - a CState value
Returns:
a double value

H_Manhattan

protected double H_Manhattan(assignment1.CMapDomain.CState arg_state,
                             CPair<java.lang.Integer,java.lang.Integer> arg_Goal)
Manhattan distance, with respect paid towards the cost of turning

Parameters:
arg_state - an IState value
Returns:
a double value

Serialize

public void Serialize(java.io.OutputStream arg_outputstream)

ConvertDirection

protected static int ConvertDirection(assignment1.CMapDomain.Direction arg_direction)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object