shipment table structure#
An output table for the freight shipment attributes, and mode choice results, including: the trade identifier, mode used, shipping cost, shipment size, shipment frequencies, if the shipment use distribution center or no, and if that particular shipment is simulated that day or no
Field |
Type |
NULL allowed |
Default Value |
Foreign key |
Description |
---|---|---|---|---|---|
shipment* |
INTEGER |
NO |
The unique identifier of this shipment |
||
trade_pair |
INTEGER |
NO |
0 |
Trade_Flow(trade_pair) |
The trade identifier from the trade flow table |
mode |
INTEGER |
NO |
0 |
The freight mode used for the shipment (truck, rail, air, courier) - TODO: corresponds to the FreightModeType enum |
|
total_cost |
NUMERIC |
NO |
0 |
Total shipping cost of annual shipments (units: $USD) |
|
shipment_size |
NUMERIC |
NO |
0 |
Shipment size (units: metric tons) |
|
days_btw_orders |
NUMERIC |
NO |
0 |
Time interval between two subsequent orders (units: days) |
|
use_distribution |
INTEGER |
NO |
0 |
boolean flag - is this shipment using a distribution center? |
|
is_simulated |
INTEGER |
NO |
0 |
boolean flag - is the movement of this shipment simulated this day? |
(* - Primary key)
The SQL statement for table and index creation is below.
CREATE TABLE Shipment (
"shipment" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"trade_pair" INTEGER NOT NULL DEFAULT 0,
"mode" INTEGER NOT NULL DEFAULT 0,
"total_cost" NUMERIC NOT NULL DEFAULT 0,
"shipment_size" NUMERIC NOT NULL DEFAULT 0,
"days_btw_orders" NUMERIC NOT NULL DEFAULT 0,
"use_distribution" INTEGER NOT NULL DEFAULT 0,
"is_simulated" INTEGER NOT NULL DEFAULT 0,
CONSTRAINT trade_pair_fk FOREIGN KEY (trade_pair)
REFERENCES Trade_Flow (trade_pair) DEFERRABLE INITIALLY DEFERRED
);