- PlayerModel.java now returns the full array of output nodes instead of just their activation states. This exposes their strengths.
This commit is contained in:
@@ -22,7 +22,7 @@ public class Referee implements Runnable {
|
||||
|
||||
private Board board;
|
||||
private BoardPanel boardPanel;
|
||||
private Player computerPlayer;
|
||||
private final Player computerPlayer;
|
||||
|
||||
private final HumanPlayer humanPlayer = new HumanPlayer();
|
||||
private final MainFrame mf;
|
||||
@@ -181,7 +181,7 @@ public class Referee implements Runnable {
|
||||
// Some changes will probably be necessary to put it in the
|
||||
// right place and also to get the node weights. But... all in
|
||||
// due time.
|
||||
getPlayerModel().getPrediction(getBoardState());
|
||||
getPlayerModel().getOutputNodes(getBoardState());
|
||||
}
|
||||
|
||||
mf.updateMessage(getMessage());
|
||||
|
||||
@@ -132,19 +132,9 @@ public class PlayerModel implements Serializable {
|
||||
return outputNode.length;
|
||||
}
|
||||
|
||||
public boolean[] getPrediction(boolean[] input) {
|
||||
public Node[] getOutputNodes(boolean[] input) {
|
||||
if (input.length == inputNode.length) {
|
||||
boolean[] prediction = new boolean[outputNode.length];
|
||||
|
||||
for (int i = 0; i < input.length; i++) {
|
||||
inputNode[i].setStimulation(input[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < prediction.length; i++) {
|
||||
prediction[i] = outputNode[i].axon();
|
||||
}
|
||||
|
||||
return prediction;
|
||||
return outputNode;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user