Class Controller

java.lang.Object
it.unitn.disi.ds1.qtop.Controller

public class Controller extends Object
Controller for the simulation.
  • Constructor Details

    • Controller

      public Controller(Simulation simulation, UserInterface ui)
      Constructor for the Controller.
      Parameters:
      simulation - the simulation
      ui - the user interface
  • Method Details

    • startSimulation

      public void startSimulation(int numberOfNodes, int numberOfClients, int voteTimeout, int writeTimeout)
      Start the simulation (network), with the given parameters.
      Parameters:
      numberOfNodes - number of nodes
      numberOfClients - number of clients
      voteTimeout - vote timeout
      writeTimeout - write timeout
    • crashNode

      public void crashNode(int crashType)
      Make crash a Node.
      Parameters:
      crashType - the type of crash
    • exitSimulation

      public void exitSimulation()
      Quit.
    • clientMenu

      public void clientMenu()
      Print the menu to tty.