Getting started with Eventsim

Author:Taiwo Kareem
Contact:taiwo.kareem36@gmail.com

Eventsim is a python package that uses various useful tools in simulating discrete system events based on outcome and probabilities easily. It contains three main modules namely:

  • Discrete

    has a class Calculate which has six methods for simplifying and calculating:

    1. probability
    2. estimated variance
    3. estimated mean
    4. estimated standard deviation
    5. expectation value
    6. discreteEmp

    as well as two other methods trimval that takes in one argument, (numbers or lists and strips it of leading zeros and round up to 4 decimal places

    and trimlist that takes in as many arguments as possible and does the same thing trimval does but very useful if there is a nested list in the list of arguments. It also round up numbers to 3 decimal places

    They both help to display lists and numbers in a better and easier way to read rather than have values with many leading decimal numbers in a list keeping it concise.


  • Randgen

    contains a class Generate which has five methods for simplifying and generating:

    1. random outcome,
    2. a unique outcome
    3. times of occurrence of outcome
    4. probability of occurrence
    5. cummulative probability of occurrence
  • Simevent

    contains three classes Randomsim, Simulate and Simtable for simplifying, generating and displaying:

    1. interarrival time
    2. service time
    3. arrival time
    4. time when service begins
    5. time when service ends
    6. wait time in queue
    7. time customer spends in system
    8. idle time of server
    9. table display data format

Randomsim is used to generate random values to populate the inter-arrival and service time which is then used to calculate the rest. It takes in two arguments as input. inter-arrival time list and service time list.

Simulate is more flexible in that it allows you to input your values. first argument being the inter-arrival time and the second argument being service time.

Simtable displays the given result as a table using the tkinter module. It takes two arguments, being an instance of any of the Randomsim or Simulate class and Tk().

Note

Tk() must be the second argument of the Simtable instance or it would not work

Downloading Eventsim

To use eventsim modules, you first need to download it from the python packaging website or if you have pip or easy_install installed, go to the command line (terminal) and type:

easy_install eventsim

or

pip install eventsim