Coder Social home page Coder Social logo

crazymarket's Introduction

crazyMarket

This Java program is designed to simulate the operation of a market. The market includes 1 cash register and 2 queues (qServer and qLottery). The rules for customers receiving service and being added to queues are as follows:

  • In the qServer queue, if the waiting time of the next customer is greater than or equal to the Wthreshold value, the customer at the front of the queue is served, and the customer is removed from the queue.
  • If the waiting time is less than the Wthreshold value, the customer is added to the qLottery queue, and the next customer to be served from this queue is selected with a random number.

How It Works

The program is defined within the MarketSimulator class. Customer arrival times and service times are calculated using exponential distribution. As simulation time progresses, there can be two different events:

  • Customer Arrival: A new customer arrives at the market and is added to the queue.
  • Customer Service and Departure: The customer at the front of the queue receives service and leaves the cash register.

Setup

  1. Ensure that Java JDK is installed.
  2. Download or clone the project to your computer.
  3. Navigate to the project folder and open the terminal.
  4. Run the following command:

Requirements

  • Java JDK 8 or higher
  • Java IDE (optional)

crazymarket's People

Contributors

melisaates avatar

Stargazers

Arman Gencer avatar

Watchers

 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.