Skip to content

Commit

Permalink
Merge branch 'v0.9.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSoemers committed Jul 4, 2020
2 parents b0aa037 + 63080eb commit c7db8ea
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ is no concrete timeline for when this will be supported.

### AI Development

1. Download [Ludii's JAR file](http://ludii.games/downloads.php). This is the
1. Download [Ludii's JAR file](http://ludii.games/download.php). This is the
JAR file that can also be used to launch the Ludii application.
2. Create a new Java project using your favourite IDE. You can also create a
fork of this [github repository](https://github.com/Ludeme/LudiiExampleAI)
Expand Down Expand Up @@ -112,12 +112,12 @@ for visual inspections of your agent's behaviour during development, etc.),
please cite [our paper on the Ludii system](https://arxiv.org/abs/1905.05013).
This can be done using the following BibTeX entry:

@misc{Piette2019Ludii,
Author = {{\'E}ric Piette and Dennis J. N. J. Soemers and Matthew Stephenson and Chiara F. Sironi and Mark H. M. Winands and Cameron Browne},
@inproceedings{Piette2020Ludii,
Author = {{\'E}. Piette and D. J. N. J. Soemers and M. Stephenson and C. F. Sironi and M. H. M. Winands and C. Browne},
Title = {Ludii - The Ludemic General Game System},
Year = {2019},
Eprint = {arXiv:1905.05013},
url = {https://arxiv.org/abs/1905.05013}
Year = {2020},
booktitle = {Proceedings of the 2020 European Conference on Artificial Intelligence},
note = {To appear.}
}

## Background Info
Expand All @@ -142,6 +142,7 @@ Alternatively, the following email address may be used: `ludii(dot)games(at)gmai

## Changelog

- 4 July, 2020: Updated repository for compatibility with new version 0.9.4 of Ludii.
- 3 April, 2020: Updated repository for compatibility with new version 0.6.1 of Ludii.
- 13 December, 2019: Updated repository for compatibility with new version 0.5.0 of Ludii.
- 27 November, 2019: Updated repository for compatibility with new version 0.4.1 of Ludii.
Expand Down
2 changes: 1 addition & 1 deletion src/experiments/RunCustomMatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.List;

import game.Game;
import player.utils.GameLoader;
import random.RandomAI;
import search.mcts.MCTS;
import util.AI;
import util.Context;
import util.GameLoader;
import util.Trial;
import util.model.Model;

Expand Down
4 changes: 2 additions & 2 deletions src/experiments/RunLudiiEvalGamesSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.util.Arrays;

import game.Game;
import player.experiments.EvalGamesSet;
import player.utils.GameLoader;
import random.RandomAI;
import search.mcts.MCTS;
import supplementary.experiments.EvalGamesSet;
import util.AI;
import util.GameLoader;

/**
* Example of an experiment that uses Ludii's built-in EvalGamesSet class to
Expand Down
10 changes: 5 additions & 5 deletions src/experiments/Tutorial.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import java.util.List;

import game.Game;
import game.types.GameType;
import game.types.state.GameType;
import main.FileHandling;
import main.collections.FastArrayList;
import mcts.ExampleUCT;
import player.utils.GameLoader;
import random.RandomAI;
import util.AI;
import util.Context;
import util.GameLoader;
import util.Move;
import util.Trial;
import util.model.Model;
Expand Down Expand Up @@ -62,7 +62,7 @@ public static void main(final String[] args)

// loop through all the "container states" of the game state
// (in many games there is just a board, but there may also be hands, etc.)
for (final ContainerState containerState : trial.state().containerStates())
for (final ContainerState containerState : context.state().containerStates())
{
// for every container state we find (often just 1), we'll print a few things:

Expand All @@ -87,7 +87,7 @@ public static void main(final String[] args)
game.apply(context, firstMove);

// let's print our empty/who/what again, see how they have changed
for (final ContainerState containerState : trial.state().containerStates())
for (final ContainerState containerState : context.state().containerStates())
{
System.out.println("Empty locations = " + containerState.emptyChunkSetCell());
System.out.println("Who = " + containerState.cloneWhoCell().toChunkString());
Expand All @@ -101,7 +101,7 @@ public static void main(final String[] args)
game.apply(context, secondMove);

// let's have a final look at how our state looks after this second move
for (final ContainerState containerState : trial.state().containerStates())
for (final ContainerState containerState : context.state().containerStates())
{
System.out.println("Empty locations = " + containerState.emptyChunkSetCell());
System.out.println("Who = " + containerState.cloneWhoCell().toChunkString());
Expand Down
12 changes: 6 additions & 6 deletions src/mcts/ExampleDUCT.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import util.AI;
import util.Context;
import util.Move;
import util.Trial;
import util.action.Action;
import utils.AIUtils;

Expand Down Expand Up @@ -94,14 +93,15 @@ public ExampleDUCT()
}
}

Trial trialEnd = current.context.trial();
Context contextEnd = current.context;

if (!trialEnd.over())
if (!contextEnd.trial().over())
{
// Run a playout if we don't already have a terminal game state in node
trialEnd = game.playout
contextEnd = new Context(contextEnd);
game.playout
(
new Context(current.context),
contextEnd,
null,
-1.0,
null,
Expand All @@ -115,7 +115,7 @@ public ExampleDUCT()

// This computes utilities for all players at the of the playout,
// which will all be values in [-1.0, 1.0]
final double[] utilities = AIUtils.utilities(trialEnd.state());
final double[] utilities = AIUtils.utilities(contextEnd);

// Backpropagate utilities through the tree
while (current != null)
Expand Down
12 changes: 6 additions & 6 deletions src/mcts/ExampleUCT.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import util.AI;
import util.Context;
import util.Move;
import util.Trial;
import utils.AIUtils;

/**
Expand Down Expand Up @@ -87,14 +86,15 @@ public ExampleUCT()
}
}

Trial trialEnd = current.context.trial();
Context contextEnd = current.context;

if (!trialEnd.over())
if (!contextEnd.trial().over())
{
// Run a playout if we don't already have a terminal game state in node
trialEnd = game.playout
contextEnd = new Context(contextEnd);
game.playout
(
new Context(current.context),
contextEnd,
null,
-1.0,
null,
Expand All @@ -108,7 +108,7 @@ public ExampleUCT()

// This computes utilities for all players at the of the playout,
// which will all be values in [-1.0, 1.0]
final double[] utilities = AIUtils.utilities(trialEnd.state());
final double[] utilities = AIUtils.utilities(contextEnd);

// Backpropagate utilities through the tree
while (current != null)
Expand Down

0 comments on commit c7db8ea

Please sign in to comment.