add javaFX gradle plugin and switch to java11 and add system.outs for error detecting

- The current implementation will not converge to the correct behaviour. See comment in MonteCarlo class for more details
This commit is contained in:
2019-12-10 15:37:20 +01:00
parent 55d8bbf5dc
commit 584d6a1246
8 changed files with 53 additions and 38 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import core.RNG;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class GreedyPolicy<A extends Enum> implements Policy<A> {
@@ -17,7 +18,7 @@ public class GreedyPolicy<A extends Enum> implements Policy<A> {
List<A> equalHigh = new ArrayList<>();
for(Map.Entry<A, Double> actionValue : actionValues.entrySet()){
System.out.println(actionValue.getKey()+ " " + actionValue.getValue() );
// System.out.println(actionValue.getKey() + " " + actionValue.getValue());
if(highestValueAction == null || highestValueAction < actionValue.getValue()){
highestValueAction = actionValue.getValue();
equalHigh.clear();
@@ -27,6 +28,6 @@ public class GreedyPolicy<A extends Enum> implements Policy<A> {
}
}
return equalHigh.get(RNG.getRandom().nextInt(equalHigh.size()));
return equalHigh.get(new Random().nextInt(equalHigh.size()));
}
}