DSIMA
|
Functions | |
def | compute |
def | simulateInstance |
Simulate an instance. More... | |
def | computationThread |
Computation thread of the instance generator. More... | |
def | terminateProcesses |
def | interact |
Interact with the user and with the instance simulator module. More... | |
def | isComputing |
Send a message with the computing status. More... | |
Variables | |
int | MAX_ITERATIONS = 10 |
Maximum number of iterations of a simulation. More... | |
float | CONVERGENCE_TOLERANCE = 0.005 |
Numerical tolerance on the convergence. More... | |
int | MAX_THREADS = 8 |
Maximum threads. More... | |
tuple | jobs = queue.Queue() |
Jobs to perform. More... | |
tuple | computingLock = threading.Lock() |
Computing status. More... | |
tuple | availableThreads = queue.Queue() |
List of available threads where each element is a number. More... | |
list | errors = [] |
Errors list where each error is a dictionary. More... | |
tuple | printLock = threading.Lock() |
Lock to print. More... | |
tuple | errorsLock = threading.Lock() |
Lock to add an error to the errors list. More... | |
dictionary | processList = {} |
Running processes. More... | |
string | simulatorPath = './simulator' |
Simulator path. More... | |
int | progression = 0 |
def implementation.server.isinterface.computationThread | ( | job | ) |
Computation thread of the instance generator.
job | Job to be done. |
def implementation.server.isinterface.compute | ( | ) |
def implementation.server.isinterface.interact | ( | client, | |
message | |||
) |
Interact with the user and with the instance simulator module.
client | Client we are interacting with. |
message | Client's message. |
def implementation.server.isinterface.isComputing | ( | client, | |
message | |||
) |
Send a message with the computing status.
def implementation.server.isinterface.simulateInstance | ( | threadId, | |
instanceDirectory, | |||
hash, | |||
d | |||
) |
Simulate an instance.
threadId | Id of the thread using this function. |
instanceDirectory | Directory containing the instances to simulate (hash included). |
hash | Hash of the instance. |
d | Day to simulate. |
def implementation.server.isinterface.terminateProcesses | ( | ) |
tuple availableThreads = queue.Queue() |
List of available threads where each element is a number.
tuple computingLock = threading.Lock() |
Computing status.
float CONVERGENCE_TOLERANCE = 0.005 |
Numerical tolerance on the convergence.
list errors = [] |
Errors list where each error is a dictionary.
tuple errorsLock = threading.Lock() |
Lock to add an error to the errors list.
tuple jobs = queue.Queue() |
Jobs to perform.
int MAX_ITERATIONS = 10 |
Maximum number of iterations of a simulation.
int MAX_THREADS = 8 |
Maximum threads.
tuple printLock = threading.Lock() |
Lock to print.
dictionary processList = {} |
Running processes.
The key is the thread id and the value is the process.
int progression = 0 |
string simulatorPath = './simulator' |
Simulator path.