Package it.unitn.disi.ds1.qtop
Class Controller
java.lang.Object
it.unitn.disi.ds1.qtop.Controller
Controller for the simulation.
-
Constructor Summary
ConstructorDescriptionController
(Simulation simulation, UserInterface ui) Constructor for the Controller. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Print the menu to tty.void
crashNode
(int crashType) Make crash a Node.void
Quit.void
startSimulation
(int numberOfNodes, int numberOfClients, int voteTimeout, int writeTimeout) Start the simulation (network), with the given parameters.
-
Constructor Details
-
Controller
Constructor for the Controller.- Parameters:
simulation
- the simulationui
- 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 nodesnumberOfClients
- number of clientsvoteTimeout
- vote timeoutwriteTimeout
- 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.
-