Transport Message

Last updated on 22nd April 2024

Introduction

The TransportMessages class is built upon simudyne.core.graph.Message and contains all the necessary fields for handling movement of inventory between the Facility agents. There are 2 classes of TransportMessage that can be initialized.

  1. constructWithProducts(): creates a TransportMessage with Product classes for cargo.
  2. constructWithStrings(): creates a TransportMessage with String products for cargo.

Custom message classes can also be used with the toolkit, the TransportMessages class is provided to make defining the necessary components of cargo shipment easier.

Transport Message Class

The TransportMessages.TransportMessage class has the following fields:

public String id;
public String transportType;
public double weightCapacity;
public double volumeCapacity;
public double weight;
public double volume;
public List<Product> objectContents;
public List<String> stringContents;
public long arrivalTime;
public long departureTime;
public String origin;
public String destination;

There are also 3 ways to construct a TransportMessage that depends on how units and products are represented in your simulation.

// For using Product classes in the cargo
public void constructWithProducts(String id, String transportType, double weightCapacity, double volumeCapacity, double weight, double volume, List<Product> objectContents, long arrivalTime, long departureTime, String origin, String destination) {
        this.id = id;
        this.transportType = transportType;
        this.weightCapacity = weightCapacity;
        this.volumeCapacity = volumeCapacity;
        this.weight = weight;
        this.volume = volume;
        this.objectContents = objectContents;
        this.stringContents = null;
        this.arrivalTime = arrivalTime;
        this.departureTime = departureTime;
        this.origin = origin;
        this.destination = destination;
}
// For using String products in the cargo
public void constructWithStrings(String id, String transportType, double weightCapacity, double volumeCapacity, double weight, double volume, List<String> stringContents, long arrivalTime, long departureTime, String origin, String destination) {
        this.id = id;
        this.transportType = transportType;
        this.weightCapacity = weightCapacity;
        this.volumeCapacity = volumeCapacity;
        this.weight = weight;
        this.volume = volume;
        this.objectContents = null;
        this.stringContents = stringContents;
        this.arrivalTime = arrivalTime;
        this.departureTime = departureTime;
        this.origin = origin;
        this.destination = destination;
}

Again, depending on the scale of the units and throughput of the network Product classes, String Products, or a combination of both with yield different performance results and should be tested.