|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
sims.ihm.mdt.Simulation
public class Simulation
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface sims.InterfaceSimulation |
---|
VITESSES |
Fields inherited from interface sims.ihm.GraphicValues |
---|
CELL_SIZE, CMD_BUTTON_HEIGHT, CMD_BUTTON_WIDTH, COMMANDS_HEIGHT, COMMANDS_WIDTH, CRED_HEIGHT, CRED_WIDTH, CRS, EDIT_HEIGHT, EDIT_WIDTH, EDIT_X, EDIT_Y, GRAPH_HEIGHT, GRAPH_WIDTH, HELP_HEIGHT, HELP_WIDTH, LAST_CELL, MAIN_HEIGHT, MAIN_WIDTH, MESS_HEIGHT, MESS_WIDTH, METAL_LAF, MOTIF_LAF, POLICE, POLIZEI, TAILLE_BARRE_TACHE, TAPE_SIZE, TAPES_SPACE, TMODIF_HEIGH, TMODIF_WIDTH, TUPDT_HEIGHT, TUPDT_WIDTH, VIEW_HEIGHT, VIEW_WIDTH |
Constructor Summary | |
---|---|
Simulation(java.lang.String fileName,
TmLauncher l)
Initialize the Simulation. |
Method Summary | |
---|---|
void |
arreter()
Same as than demarrer(). |
void |
charger(java.io.File file)
Compile and load a machine from its File instance. |
void |
charger(java.lang.String fileName)
Compile and load a machine from its file name. |
void |
closeGraph()
Close the graph, by setting it non visible and put gr at null |
void |
createGraph()
cCreate the graph window, from (GraphInterface) m |
java.lang.String |
currentState()
|
void |
decVitesse()
Decreases the speed value of one, if the speed is at one starts the turbo mode and set speed value to zero. |
void |
demarrer()
Turns the boolean value stopped to his contrary, hence stop the machine if running, restart it if stopped. |
int |
getLine()
|
java.lang.String |
getNom()
|
int |
getSpace()
|
int |
getTapeNb()
|
int |
getTime()
|
int |
getVitesse()
|
int |
headPosition(int i)
Gives the head position index of the tape i. |
void |
incVitesse()
Increases the speed value of one and display a message of the modification, if the speed value was below five. |
boolean |
isGravity()
|
boolean |
isND()
|
boolean |
isProb()
|
boolean |
isStopped()
For TmLauncher, to know if machine is running when trying to edit tapes |
int |
min(int i)
|
int |
nbTapes()
|
void |
prochainPas()
To pass to the next step manually. |
void |
reinitialiser()
Reset the machine, by turning the boolean value reset at true. |
void |
run()
Starts the machine, and keep it in memory after execution to reset it, until viewing is not closed. |
void |
setTapeContent(java.lang.String word,
int tapeNb)
update the content of the tape i with word, display an error message if update fails. |
void |
setVitesse(int i)
|
void |
showGraph(boolean boo)
Show or hide the graph. |
void |
stopp()
Stop the simulation by turning the semaphore running |
java.lang.String |
wordOnTape(int i)
Asks the machine word on the tape i. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Simulation(java.lang.String fileName, TmLauncher l)
fileName
- the String of the file name.l
- the TmLauncher which created the simulation.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String wordOnTape(int i)
i
- the number of a tape, from 0 to (number of tapes - 1).
public int headPosition(int i)
i
- the number of the tape from 0 to (number of tapes - 1 )
public java.lang.String currentState()
public int nbTapes()
public void demarrer()
demarrer
in interface InterfaceSimulation
public void arreter()
arreter
in interface InterfaceSimulation
public void reinitialiser()
reinitialiser
in interface InterfaceSimulation
public void prochainPas()
prochainPas
in interface InterfaceSimulation
public java.lang.String getNom()
getNom
in interface InterfaceSimulation
public void incVitesse()
incVitesse
in interface InterfaceSimulation
public void decVitesse()
decVitesse
in interface InterfaceSimulation
public void setVitesse(int i)
public void charger(java.lang.String fileName) throws java.io.IOException, ExceptionCompilation
fileName
- a String corresponding to the file name.
java.io.IOException
ExceptionCompilation
public void charger(java.io.File file) throws java.io.IOException, ExceptionCompilation
file
- the File instance corresponding to the file.
java.io.IOException
ExceptionCompilation
public void stopp()
public boolean isND()
public boolean isProb()
public boolean isGravity()
public boolean isStopped()
public void createGraph()
public void closeGraph()
public void showGraph(boolean boo)
boo
- if true sets the graph visible, otherwise set it non visible.public int min(int i)
public int getTime()
public int getSpace()
public int getVitesse()
getVitesse
in interface InterfaceSimulation
public int getTapeNb()
public int getLine()
public void setTapeContent(java.lang.String word, int tapeNb)
tapeNb
- the number of the tape.word
- the new content of the tape, each caracter for a cell of the tape.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |