|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
cz.zcu.fav.kiv.jsim.JSimProcess
vsp.Generator
public class Generator
Transaction generator
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private int |
generated
Number of generated transactions |
private double |
lambda
Exponential distribution ratio |
private QueueWithServer |
queue1
Queue for server 1 |
private QueueWithServer |
queue2
Queue for server 2 |
Fields inherited from class cz.zcu.fav.kiv.jsim.JSimProcess |
---|
INT_REQUESTS_TO_IGNORE, myParent |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Generator(java.lang.String name,
cz.zcu.fav.kiv.jsim.JSimSimulation simulation,
double lambda,
QueueWithServer queue1,
QueueWithServer queue2)
Creates new generator |
Method Summary | |
---|---|
private QueueWithServer |
addTransaction(cz.zcu.fav.kiv.jsim.JSimLink link,
QueueWithServer queue)
Add transaction to queue |
int |
getGenerated()
Get number of generated transaction |
double |
getLq()
|
protected void |
life()
In infinite loop: - generates new transaction - generates random number from <0; 1> - if number is smaller than queue 1 probability, than add transaction to queue 1, otherwise in queue 2 - pause process in depend of lambda |
Methods inherited from class cz.zcu.fav.kiv.jsim.JSimProcess |
---|
activate, activateNow, blockOnSemaphore, cancel, compareTo, copyToMessageClipboard, createDetailedInfoWindow, equals, error, getDetailedInformationArray, getMessageBox, getObjectListItemDescription, getParent, getPrivateLock, getProcessName, getProcessNumber, getProcessState, getProcessStateAsString, getReady, getSenderIAmWaitingFor, getScheduleTime, hasBeenStarted, hasEmptyMessageClipboard, hashCode, hold, isIdle, mainSwitchingRoutine, message, messageNoNL, passivate, reactivate, readFromClipboard, receiveMessageWithBlocking, receiveMessageWithBlocking, receiveMessageWithBlocking, receiveMessageWithBlocking, receiveMessageWithoutBlocking, receiveMessageWithoutBlocking, receiveMessageWithoutBlocking, receiveMessageWithoutBlocking, run, sendMessageWithBlocking, sendMessageWithBlocking, sendMessageWithBlocking, sendMessageWithoutBlocking, sendMessageWithoutBlocking, sendMessageWithoutBlocking, setProcessState, start, toString, unblockFromSemaphore, wait |
Methods inherited from class java.lang.Thread |
---|
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double lambda
private QueueWithServer queue1
private QueueWithServer queue2
private int generated
Constructor Detail |
---|
public Generator(java.lang.String name, cz.zcu.fav.kiv.jsim.JSimSimulation simulation, double lambda, QueueWithServer queue1, QueueWithServer queue2) throws cz.zcu.fav.kiv.jsim.JSimSimulationAlreadyTerminatedException, cz.zcu.fav.kiv.jsim.JSimInvalidParametersException, cz.zcu.fav.kiv.jsim.JSimTooManyProcessesException
name
- name of generatorsimulation
- simulation objectlambda
- defined lambdaqueue1
- queue for server 1queue2
- queue for server 2
cz.zcu.fav.kiv.jsim.JSimSimulationAlreadyTerminatedException
cz.zcu.fav.kiv.jsim.JSimInvalidParametersException
cz.zcu.fav.kiv.jsim.JSimTooManyProcessesException
Method Detail |
---|
protected void life()
life
in class cz.zcu.fav.kiv.jsim.JSimProcess
private QueueWithServer addTransaction(cz.zcu.fav.kiv.jsim.JSimLink link, QueueWithServer queue) throws cz.zcu.fav.kiv.jsim.JSimSecurityException, cz.zcu.fav.kiv.jsim.JSimInvalidParametersException
link
- queue
-
cz.zcu.fav.kiv.jsim.JSimSecurityException
cz.zcu.fav.kiv.jsim.JSimInvalidParametersException
public int getGenerated()
public double getLq()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |