Giter Site home page Giter Site logo

kueuenetworksimulator's Introduction

KueueNetworkSimulator

A queuing network simulator written in Kotlin. Part of the Computer Simulation course at IUST (Fall 2021).

Networks of queues are systems in which a number of queues are connected by what's known as customer routing. When a customer is serviced at one node it can join another node and queue for service, or leave the network.

Usage

In order to build the application and its components you need GraalVM, which is a high-performance JDK.

KueueNetworkSimulator (KNS) allows for defining your own queue networks using the QueueNetworkDescription class. A queue network description is described in a very similar fashion to describing graphs using adjacency lists. Kotlin's idiomatic syntax allows for defining network descriptions very easily, in some cases using less code than well-known graph DSLs.

Example:

val sampleNetwork = QueueNetworkDescription(
    startNodes = listOf(
        StartNodeDescription(
            id = 1,
            serviceRate = 2.0,
            arrivalRate = 1.0
        )
    ),
    queueNodes = listOf(
        QueueNodeDescription(
            id = 2,
            serviceRate = 4.0
        ),
        QueueNodeDescription(
            id = 3,
            serviceRate = 3.0
        )
    ),
    edges = listOf(
        EdgeDescription(1, 2, 0.4),
        EdgeDescription(1, 3, 0.6)
    )
)

The above code corresponds to the following queue network:

Internals

Under the hood, there are three main steps to each KNS app.

Step1 - Network Creation

KNS uses the NetworkCreator class to convert a QueueNetworkDescription object to a QueueNetwork object, which is the runtime representation of the queue network, and is used in Step 2 and Step3.

Step 2 - Graph GUI Generation

KNS offers a GUI which automatically displays the corresponding queue network using its graph representation. The '''GraphvizGenerator''' class is a mapper that converts '''QueueNetwork''' objects to their standard GraphViz representations. Next, the graphviz-java library is used to draw the input graph.

Step 3 - Simulation

Finally the QueueNetworkSimulator class is used to perform the simulation on the QueueNetwork object. KNS uses the standard Discrete-time Event Simulation paradigm. The simulator uses an event queue which is filled with both arrival and departure events. As the events are executed the simulation clock progresses and logs are recorded for future reporting.

kueuenetworksimulator's People

Watchers

James Cloos avatar Mobin Dariush avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.