GithubHelp home page GithubHelp logo

sahilolivet / maersk---case-study-round Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

Shipping Terminal Simulation This repository contains simulations of vessel operations and logistics at a shipping terminal using SimPy. The simulations cover different resource management strategies

Jupyter Notebook 100.00%

maersk---case-study-round's Introduction

MAERSK---Case-Study-Round

Container Terminal Simulation

This repository contains three versions of a simulation for a container terminal using SimPy. The simulation involves vessels arriving at a terminal, berthing, unloading containers using quay cranes, and transporting containers to yard blocks using trucks.

Table of Contents

Overview

The simulation models the operations of a container terminal where vessels arrive, berth at the terminal, unload containers using quay cranes, and transport containers to yard blocks using trucks. The key components of the simulation include the environment, processes, and resources.

Environment

The environment is simulated using the SimPy library, which provides a framework for discrete-event simulation. The main environment in this simulation is represented by simpy.Environment().

Processes

  • Vessel Arrival Generator: Generates vessels arriving at the terminal based on an exponential distribution.
  • Vessel Process: Manages the vessel's arrival, berthing, unloading of containers, and departure.
  • Crane and Truck Operations: Handle the movement of containers from the vessel to the terminal trucks and then to the yard blocks.

Resources

  • Berths: Limited to 2, representing the slots available for vessels to berth.
  • Cranes: Limited to 2, used for unloading containers from vessels.
  • Trucks: Limited to 3, used for transporting containers to yard blocks.

Events Logged

The following events are logged with timestamps to show the sequence and timing of activities in the terminal:

  • Vessel Arrival: Logs the arrival time of each vessel.
  • Vessel Berthing: Logs when a vessel berths and its waiting time if it had to wait for a berth to become available.
  • Crane Operations: Logs when a crane starts unloading a container from a vessel.
  • Truck Operations: Logs when a container is placed on a truck, when the truck starts transporting the container to the yard block, and when the truck returns to the quay crane.
  • Vessel Departure: Logs when a vessel departs after unloading all containers.

Code Versions

1. Simulation with 'with' statement

This version uses the with statement for resource requests and releases. It simplifies resource management by automatically handling resource release at the end of the with block. This is a straightforward approach that ensures resources are properly managed without needing explicit release calls.

2. Simulation with Manual Resource Management

This version manually controls resource requests and releases, providing more explicit control over the resource lifecycle. This approach allows for finer control over when and how resources are released, which can be useful in complex scenarios or when specific resource management strategies are needed.

In this version, the constants provided in the task description remain the same, only the code structure is modified to avoid using the with statement.

3.Priority-Based Vessel Operations: Preparing for Future Enhancements

This version introduces a priority system for vessels. Certain vessels have higher priority (e.g., carrying perishable goods) and can preempt resources from lower-priority vessels. The manual control over resource management is used here to implement this priority system, ensuring that higher-priority vessels are serviced first while still ensuring fair service to lower-priority vessels.

How to Run

  1. Install Dependencies: Make sure you have Python and SimPy installed. You can install SimPy using pip:
    pip install simpy

maersk---case-study-round's People

Contributors

sahilolivet 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.