Skip to content

Commit

Permalink
Update Hipster dependency to version 1.0.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
gahrae committed Aug 24, 2015
1 parent c1b17a0 commit 0f84606
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Solution found!
15 14 7 6
Total solutions: 1
Total time: 90.49 ms
Total time: 77
Total number of iterations: 398
+ Solution 1:
- States:
Expand All @@ -99,17 +99,17 @@ What is this output?

The output includes the challenge requirements to display the completed board.

It also displays `Additional details...` which is provided by Hipster to show which states were used, and actions taken.
It also displays `Additional details...` which is provided by Hipster to show the time taken in milliseconds, what actions were taken and states generated.

Items in the list of states are of the form (x,y)=v. The `x` and `y` values are the coordinate location in the board, and `v` is the value at this spot.


Performance
===========

Below are the run times for sample input files.
Below are the run times in milliseconds for sample input files.

**SampleInput1.txt** : `Total time: 5.656 s`
**SampleInput1.txt** : `Total time: 5830` (5.8 s)
```
XX XX XX XX -- 53 XX XX XX XX
XX XX XX XX -- -- XX XX XX XX
Expand All @@ -123,7 +123,7 @@ XX XX XX XX -- -- XX XX XX XX
XX XX XX XX 7 -- XX XX XX XX
```

**SampleInput2.txt** : `Total time: 118.7 ms`
**SampleInput2.txt** : `Total time: 121` (121 ms)
```
-- 33 35 -- -- XX XX XX
-- -- 24 22 -- XX XX XX
Expand All @@ -135,14 +135,14 @@ XX XX XX XX -- 7 -- --
XX XX XX XX XX XX 5 --
```

**SampleInput3_impossible.txt** : `Total time: 0 ms`
**SampleInput3_impossible.txt** : `Total time: 0 ms` (0 ms)
```
XX XX XX XX XX
XX 1 XX -- XX
XX XX XX XX XX
```

**SampleInput4.txt** : `Total time: 747.7 ms`
**SampleInput4.txt** : `Total time: 911` (911 ms)
```
30 -- 26 -- 16 -- -- 11
-- -- -- 18 -- -- -- 9
Expand All @@ -154,7 +154,7 @@ XX XX XX XX XX
61 -- -- -- -- -- 46 --
```

**SampleInput5.txt** : `Total time: 1.216 s`
**SampleInput5.txt** : `Total time: 1343` (1.3 s)
```
-- -- -- -- 39 XX XX XX
-- -- 7 40 -- XX XX XX
Expand All @@ -166,7 +166,7 @@ XX XX XX XX -- 19 21 --
XX XX XX XX XX XX -- 23
```

**SampleInput6.txt** : `Total time: 83.21 ms`
**SampleInput6.txt** : `Total time: 77` (77 ms)
```
-- -- -- --
12 -- 1 --
Expand Down Expand Up @@ -201,6 +201,7 @@ Where appropriate I used streams instead of for loops. So instead of iterating o
* Ordering which filter conditions are checked first by their "effort" increased performance.
* Care should be taken to check the heuristic is actually working.


References
==========

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<dependency>
<groupId>es.usc.citius.hipster</groupId>
<artifactId>hipster-core</artifactId>
<version>1.0.0-rc1</version>
<version>1.0.0-rc2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/hidatohippy/HidatoBoardSearcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.ArrayList;
import java.util.List;

import com.google.common.base.Predicate;

import es.usc.citius.hipster.algorithm.Algorithm;
import es.usc.citius.hipster.algorithm.Hipster;
import es.usc.citius.hipster.model.Transition;
Expand All @@ -15,6 +13,7 @@
import es.usc.citius.hipster.model.impl.WeightedNode;
import es.usc.citius.hipster.model.problem.ProblemBuilder;
import es.usc.citius.hipster.model.problem.SearchProblem;
import es.usc.citius.hipster.util.Predicate;

public class HidatoBoardSearcher {

Expand Down Expand Up @@ -45,6 +44,8 @@ public static Algorithm<HidatoAction, HidatoBoard, WeightedNode<HidatoAction, Hi
.build();

Predicate<WeightedNode<HidatoAction, HidatoBoard, Double>> predicate = getPredicateFunction();

Predicate<String> emptyTest = s -> s.isEmpty();

return Hipster.createAStar(problem).search(predicate);
}
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/hidatohippy/HidatoBoardSearcherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

import org.junit.Test;

import com.google.common.base.Predicate;

import es.usc.citius.hipster.model.function.ActionFunction;
import es.usc.citius.hipster.model.impl.WeightedNode;
import es.usc.citius.hipster.model.problem.ProblemBuilder;
import es.usc.citius.hipster.model.problem.SearchProblem;
import es.usc.citius.hipster.util.Predicate;

public class HidatoBoardSearcherTest {

Expand Down

0 comments on commit 0f84606

Please sign in to comment.