Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Search Result printed Action list is now in reverse order (in v1.0.0.rc2 vs v1.0.0.rc1) #141

Closed
gahrae opened this issue Aug 27, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@gahrae
Copy link
Contributor

gahrae commented Aug 27, 2015

When a Search Result is printed it displays a list of actions.

In version v1.0.0-rc1 the list of actions could be read left to right. Now in v1.0.0-rc2 the list needs to be read right to left. I believe that the actions should appear in the list in sequence from left to right.

// To print a search result..
System.out.println( Hipster.createAStar(problem).search(predicate) );

For example, below is a completed Hidato board. It starts at 1, then moves to 2. The action that describes this step is MOVE_UP.

Completed Hidato board...
11 10  <2>  3 
12  9  [1]  4 
13 16   8   5 
15 14   7   6 

Below is the printed search results from version rc1 and rc2. Observe that the first action of MOVE_UP now appears at the end of the action list in the version rc2 output. And that the action list is now in reverse order.

rc1 output - Action list in correct order, left to right

Total solutions: 1
Total time: 77
Total number of iterations: 398
+ Solution 1: 
 - States: 
    [(2,1)=1, (2,0)=2, (3,0)=3, (3,1)=4, (3,2)=5, (3,3)=6, (2,3)=7, (2,2)=8, (1,1)=9, (1,0)=10, (0,0)=11, (0,1)=12, (0,2)=13, (1,3)=14, (0,3)=15]
 - Actions: 
    [MOVE_UP, MOVE_RIGHT, MOVE_DOWN, MOVE_DOWN, MOVE_DOWN, MOVE_LEFT, MOVE_UP, MOVE_UP_LEFT, MOVE_UP, MOVE_LEFT, MOVE_DOWN, MOVE_DOWN, MOVE_DOWN_RIGHT, MOVE_LEFT]
 - Search information: 
    WeightedNode{state=(0,3)=15, cost=14.0, estimation=1.0, score=15.0}

rc2 output - Action list in reverse order, right to left

Total solutions: 1
Total time: 78
Total number of iterations: 398
+ Solution 1: 
 - States: 
    [(2,1)=1, (2,0)=2, (3,0)=3, (3,1)=4, (3,2)=5, (3,3)=6, (2,3)=7, (2,2)=8, (1,1)=9, (1,0)=10, (0,0)=11, (0,1)=12, (0,2)=13, (1,3)=14, (0,3)=15]
 - Actions: 
    [MOVE_LEFT, MOVE_DOWN_RIGHT, MOVE_DOWN, MOVE_DOWN, MOVE_LEFT, MOVE_UP, MOVE_UP_LEFT, MOVE_UP, MOVE_LEFT, MOVE_DOWN, MOVE_DOWN, MOVE_DOWN, MOVE_RIGHT, MOVE_UP]
 - Search information: 
    WeightedNode{state=(0,3)=15, cost=14.0, estimation=1.0, score=15.0}

I believe that the actions should appear in sequence from left to right as in rc1.

Best regards,

Gareth

@gonzalezsieira gonzalezsieira added this to the v1.0.0 milestone Aug 27, 2015
@gonzalezsieira gonzalezsieira self-assigned this Aug 27, 2015
@pablormier pablormier added the bug label Aug 27, 2015
gahrae referenced this issue in gahrae/dpader Aug 27, 2015
gahrae referenced this issue in gahrae/HidatoHippy Aug 27, 2015
michaelhaaf pushed a commit to michaelhaaf/hipster that referenced this issue Dec 2, 2015
Removed redundant reversion of the list of actions in class
Algorithm.SearchResult.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants