Skip to content

Configuration files

Anderson edited this page Jul 1, 2016 · 4 revisions

##Experiment configuration (.xml)

The file containing the experiment configuration is a xml file in which the parameters are equivalent to the ones passed in the command line interface. Plus, the configuration file allows the specification of probabilities under which strategies should be chosen under Nash Equilibrium. Configurations are enclosed under the root tag <config>..</config>

Each part of an experiment is defined in a section (delimited by respective tags). Sections are discussed below.

Strategies

Available strategies are defined inside <choices>..</choices>. Each strategy follows the standard: <choice name="strategy-name nashprob="prob-of-selection" /> where name is a strategy present in the pool of matches and 0 < nashprob < 1 is the probability of selection of the given strategy under Nash Equilibrium. An example of the strategies section is below:

<choices>
    <choice name="Xelnaga" nashprob = ".41975" />
    <choice name="CruzBot" nashprob = ".28395" />
    <choice name="NUSBot" nashprob = "0" />
    <choice name="Aiur" nashprob = "0" />
    <choice name="Skynet" nashprob = ".2936" />
</choices>

Strategy selection methods

Strategy selection methods that will participate in the experiment are under <players>..</players>. Each method follows the standard <player name="player_name" /> where player_name is an available strategy selection method. You can use built-in methods or program your own. For more information, check this page.

An example of the strategy selection methods section is below.

<players>
    <player name="nash" />
    <player name="enash" />
    <player name="frequentist" />
    <player name="replyscore" />
    <player name="egreedy" />
    <player name="Xelnaga" />
    <player name="Aiur" />
    <player name="Skynet" />
    <player name="NUSBot" />
    <player name="CruzBot" />
</players>

Note that some players are actually names of strategies (Xelnaga, Aiur, Skynet, NUSBot and CruzBot). This way, strategy "unique" will be instantiated and will select the given strategy every time.

Parameters

Parameters are defined under <parameters>..</parameters>. Parameter structure is <param_name value="param_value" />

Next we show an example of which parameters are accepted by StarcraftNash.

<enash-exploitation value="0.4" />                          <!-- Value of the exploitation in an e-nash strategy -->
<egreedy-exploration value="0.2" />                         <!-- Value of the exploration in an e-greedy strategy -->
<shuffle-match-list value="true" />                         <!-- Boolean indicating if the list of matches will be shuffled -->
<scorechart-file value="config/scorechart_fortress.csv" />  <!-- Output file in CSV format with the results of every repetition of matches -->
<output-spreadsheet value="score-chart.xls" />              <!-- .xml file with outputs results -->
<output-intermediate value="intermediate" />                <!-- directory to save intermediate results  -->
<random-seed value="1" />                                   <!-- Integer with random seed for experiments -->
<repetitions value="30" />                                  <!-- Number of tournament repetitions -->
<match-pool-file value="results_demo/fortress1000.txt" />   <!-- File with the pool of matches -->
<num-matches value="1000" />                                <!-- Number of matches between pairs of techniques -->
<round-robin value="true" />                                <!-- Boolean to indicate whether to create a tournament with all strategies or not -->
<verbose value="true" />                                    <!-- Boolean that allows to print informations about the games -->
<plot value="false" />                                      <!-- Boolean that allows to plot the results -->

Entire file

Below you can find an example of a complete file for experimentation with StarcraftNash

<config>
    <choices>
        <choice name="Xelnaga" nashprob = ".41975" />
        <choice name="CruzBot" nashprob = ".28395" />
        <choice name="NUSBot" nashprob = "0" />
        <choice name="Aiur" nashprob = "0" />
        <choice name="Skynet" nashprob = ".2936" />
    </choices>

    <players>
        <player name="nash" />
        <player name="enash" />
        <player name="frequentist" />
        <player name="replyscore" />
        <player name="egreedy" />
        <player name="Xelnaga" />
        <player name="Aiur" />
        <player name="Skynet" />
        <player name="NUSBot" />
        <player name="CruzBot" />
    </players>

    <parameters>
        <enash-exploitation value="0.4" />
        <egreedy-exploration value="0.2" />
        <shuffle-match-list value="true" />
        <scorechart-file value="config/scorechart_fortress.csv" />
        <output-spreadsheet value="score-chart.xls" />
        <output-intermediate value="intermediate" />
        <random-seed value="1" />
        <repetitions value="30" />
        <match-pool-file value="results_demo/fortress1000.txt" />
        <num-matches value="1000" />
        <round-robin value="true" />
        <verbose value="true" />
        <plot value="false" />
    </parameters>
</config>

##Scorechart file Some strategy selection techniques use prior knowledge in the form of a tournament score chart among strategies. The score chart is supplied in tag scorechart-file of experiment configuration file.

It is a .csv file where its first line has the list of strategies and from the second line onwards we have the percent of victories of an strategy against another (rows and columns follow the order from the first line).

For example, consider the following score chart file:

Xelnaga,CruzBot,NUSBot,Aiur,Skynet
50,26,86,73,73
74,50,80,67,16
14,20,50,74,97
27,33,26,50,79
27,84,3,21,50

The value on 2nd row, 2nd col (26) means that Xelnaga won CruzBot on 26% of matches. Note that 2nd row of the file is the 1st of the score chart. And the 1st strategy on the list is Xelnaga. 2nd col of the file refers to 2nd strategy on the list (CruzBot). The value on 4th row, 1st col (14) means that NUSBot won Xelnaga on 14% of matches.Note that 4th row of the file is the 3rd of the score chart. And the 3rd strategy on the list is NUSBot. 1st col of the file refers to 1st strategy on the list (Xelnaga).

Note that diagonals are filled with 50, which means that strategies win 50% of matches against themselves (or that they would draw if allowed).

Clone this wiki locally