dk.brics.bisimulationGame
Class BisimulationGame

java.lang.Object
  extended by dk.brics.bisimulationGame.BisimulationGame

public class BisimulationGame
extends java.lang.Object

The main class of the application. When a game starts, check the game type:

  1. 2p remote, server:
    Setup a RMI registry and bind global objects (globalModel, messagePasser).
  2. 2p remote, client:
    Locate a remote registry at the specified host and retrieve the remote objects.
  3. Local game:
    The game controller still talks to the message passer, and if it's a 1p game, a computer player thread is started, which also talks to the message passer.
When a game ends:
  1. If an AI thread is running, tell it to quit.
  2. If the player is a server, unbind the remote objects.
  3. If the player is a client, nullify the registry.

Author:
Martin Mosegaard martinm@daimi.au.dk

Field Summary
private  AI ai
          Thread for a computer player
private  int bisimulation
          Player properties
private  int clientServerRole
          Player properties
private  GameController gameController
           
private  GameModel gameModel
           
private  GameView gameView
           
private  GlobalModel globalModel
          Global model object
private  boolean hasRegistry
           
private  MessagePasser messagePasser
          Controllers: The game controller talks to the message passer
private  OptionsModel optionsModel
           
private  java.rmi.registry.Registry reg
          Remote object registry: Used in 2p remote games
private  int role
          Player properties
private  UserProperties userProperties
          Local model objects
private  View view
          (Local) GUI objects
 
Constructor Summary
BisimulationGame()
          Starts a bisimulation game, and shows the options view.
 
Method Summary
private  StateSpace getStateSpace()
           
private  void initClient()
           
private  void initLocal()
           
private  void initServer()
           
static void main(java.lang.String[] args)
          Starts a bisimulation game with an options model and a view.
private  boolean makeLTSs()
          Construct a GrappaModel for the left and right LTSs and pass this to a GameController.
 void quitGame()
          Invoked by the game controller when the (local) player wants to quit a game.
 void startGame()
          Invoked by the options controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reg

private java.rmi.registry.Registry reg
Remote object registry: Used in 2p remote games


hasRegistry

private boolean hasRegistry

userProperties

private UserProperties userProperties
Local model objects


gameModel

private GameModel gameModel

optionsModel

private OptionsModel optionsModel

globalModel

private GlobalModel globalModel
Global model object


view

private View view
(Local) GUI objects


gameView

private GameView gameView

messagePasser

private MessagePasser messagePasser
Controllers: The game controller talks to the message passer


gameController

private GameController gameController

ai

private AI ai
Thread for a computer player


role

private int role
Player properties


clientServerRole

private int clientServerRole
Player properties


bisimulation

private int bisimulation
Player properties

Constructor Detail

BisimulationGame

public BisimulationGame()
Starts a bisimulation game, and shows the options view.

Method Detail

main

public static void main(java.lang.String[] args)
Starts a bisimulation game with an options model and a view.

Parameters:
args - Arguments are ignored

startGame

public void startGame()
Invoked by the options controller. Starts a new game.


quitGame

public void quitGame()
Invoked by the game controller when the (local) player wants to quit a game. Switch from game view to options view.


initLocal

private void initLocal()
                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

initServer

private void initServer()
                 throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

initClient

private void initClient()
                 throws java.rmi.RemoteException,
                        java.rmi.NotBoundException
Throws:
java.rmi.RemoteException
java.rmi.NotBoundException

makeLTSs

private boolean makeLTSs()
                  throws java.rmi.RemoteException
Construct a GrappaModel for the left and right LTSs and pass this to a GameController.

Throws:
java.rmi.RemoteException

getStateSpace

private StateSpace getStateSpace()