Class Simulation

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

public class Simulation extends Object
Simulation class layer between the UserInterface and the network.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new simulation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCrashNode(int crashType)
    Add a crash to the network.
    void
    Shut down the network.
    void
    start(int numberOfNodes, int numberOfClients, int voteTimeout, int writeTimeout)
    Start the network with the given parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Simulation

      public Simulation()
      Create a new simulation.
  • Method Details

    • start

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

      public void addCrashNode(int crashType)
      Add a crash to the network.
      Parameters:
      crashType - the type of crash
    • exit

      public void exit()
      Shut down the network.