vsp
Class Server

java.lang.Object
  extended by java.lang.Thread
      extended by cz.zcu.fav.kiv.jsim.JSimProcess
          extended by vsp.Server
All Implemented Interfaces:
JSimDisplayable, Comparable<JSimProcess>, Runnable

public class Server
extends JSimProcess

Server class

Author:
Jan Tichava

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  int counter
          Transactions counter
private  double deviation
          Deviation for Gaussian
private  double effectiveTime
          Effective working time
private  boolean gauss
          Is exp or Gauss?
private  double median
          Median for Gaussian
private  QueueWithServer output1
          Output queue 1
private  QueueWithServer output2
          Output queue 2
private  double probability1
          Probability for queue 1
private  QueueWithServer queue
          Assigned queue
private static boolean SILENT
          Silent mode for generating Gaussian
private  double transTq
          Real Tq
private  double ts
          Mean value
 
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
Server(String name, JSimSimulation simulation, double median, double deviation, QueueWithServer queue, QueueWithServer output1, QueueWithServer output2, double probability1)
          Creates new server
Server(String name, JSimSimulation simulation, double ts, QueueWithServer queue, QueueWithServer output1, QueueWithServer output2, double probability1)
          Creates new server
 
Method Summary
 int getCounter()
          Get count of managed transactions
 double getLoad()
          Server load
 double getTq()
          Get average Tq for one request
 double getTransTq()
          Get global Tq
protected  void life()
          In infinite loop: - checks if queue is not empty - "work" - removes transaction from queue - decides to which output queue put transaction
 
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

ts

private double ts
Mean value


queue

private QueueWithServer queue
Assigned queue


counter

private int counter
Transactions counter


transTq

private double transTq
Real Tq


output1

private QueueWithServer output1
Output queue 1


output2

private QueueWithServer output2
Output queue 2


probability1

private double probability1
Probability for queue 1


effectiveTime

private double effectiveTime
Effective working time


median

private double median
Median for Gaussian


deviation

private double deviation
Deviation for Gaussian


SILENT

private static final boolean SILENT
Silent mode for generating Gaussian

See Also:
Constant Field Values

gauss

private boolean gauss
Is exp or Gauss?

Constructor Detail

Server

public Server(String name,
              JSimSimulation simulation,
              double ts,
              QueueWithServer queue,
              QueueWithServer output1,
              QueueWithServer output2,
              double probability1)
       throws JSimSimulationAlreadyTerminatedException,
              JSimInvalidParametersException,
              JSimTooManyProcessesException
Creates new server

Parameters:
name - server name
simulation - simulation object
ts - mean service time
queue - assigned queue
output1 - output queue 1
output2 - output queue 2
probability1 - probability for queue 1
Throws:
JSimSimulationAlreadyTerminatedException
JSimInvalidParametersException
JSimTooManyProcessesException

Server

public Server(String name,
              JSimSimulation simulation,
              double median,
              double deviation,
              QueueWithServer queue,
              QueueWithServer output1,
              QueueWithServer output2,
              double probability1)
       throws JSimSimulationAlreadyTerminatedException,
              JSimInvalidParametersException,
              JSimTooManyProcessesException
Creates new server

Parameters:
name - server name
simulation - simulation object
median - median
deviation - deviation
queue - assigned queue
output1 - output queue 1
output2 - output queue 2
probability1 - probability for queue 1
Throws:
JSimSimulationAlreadyTerminatedException
JSimInvalidParametersException
JSimTooManyProcessesException
Method Detail

life

protected void life()
In infinite loop: - checks if queue is not empty - "work" - removes transaction from queue - decides to which output queue put transaction

Overrides:
life in class JSimProcess

getCounter

public int getCounter()
Get count of managed transactions

Returns:
the counter

getTransTq

public double getTransTq()
Get global Tq

Returns:
the transTq

getTq

public double getTq()
Get average Tq for one request

Returns:
Tq

getLoad

public double getLoad()
Server load

Returns:
load