|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.misc.AIDemo
This class is meant to be an illustrative example of how to use the adjudication routines to evaluate moves, as might be needed by an AI (computer) player or the like.
It is to be run from the command line. Most exceptions will cause an abort, and be displayed on the command line.
Normally, jDip will create a World object, which has an initial TurnState. Orders and units are added to the TurnState. When the TurnState is resolved, a new TurnState is added to the world.
In our case, we will be doing things a bit differently. We are not trying to create an entire game (though we could!).
This demo will set up a position involving all 7 powers on a Standard map (this position is NOT the initial starting position). The goal is to find the set of orders which will allow Germany to take the Russian province of Warsaw, which contains a supply center. We use the adjudicator to evaluate several order sets until we find the order set that will accomplish our goal. A secondary goal is to ensure any German units don't get dislodged by Russia.
Note that this is not an AI, and just a demo. As such, the other powers are all assumed to have their units Hold in position. Furthermore, the order sets are not generated by an algorithm, but pre-selected.
N.B.: note the potential naming conflict between dip.world.Map and java.util.Map.
Constructor Summary | |
AIDemo()
Create the AIDemo |
Method Summary | |
static void |
main(java.lang.String[] args)
Command-line entry point |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AIDemo() throws java.lang.Exception
Method Detail |
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |