mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-05 23:38:52 -06:00
Implement plant storage
This commit is contained in:
@@ -49,33 +49,35 @@ The mathematical model employed by RELOG is based on three main components:
|
||||
|
||||
## Constants
|
||||
|
||||
| Symbol | Description | Unit |
|
||||
| :-------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- |
|
||||
| $K^{\text{dist}}_{uv}$ | Distance between plants/centers $u$ and $v$ | km |
|
||||
| $K^\text{cap-init}_p$ | Initial capacity of plant $p$ | tonne |
|
||||
| $K^\text{cap-max}_p$ | Maximum capacity of plant $p$ | tonne |
|
||||
| $K^\text{cap-min}_p$ | Minimum capacity of plant $p$ | tonne |
|
||||
| $K^\text{disp-limit}_{mt}$ | Maximum amount of material $m$ that can be disposed of (globally) at time $t$ | tonne |
|
||||
| $K^\text{disp-limit}_{mut}$ | Maximum amount of material $m$ that can be disposed of at plant/center $u$ at time $t$ | tonne |
|
||||
| $K^\text{em-limit}_{gt}$ | Maximum amount of greenhouse gas $g$ allowed to be emitted (globally) at time $t$ | tonne |
|
||||
| $K^\text{em-plant}_{gpt}$ | Amount of greenhouse gas $g$ released by plant $p$ at time $t$ for each tonne of input material processed | tonne/tonne |
|
||||
| $K^\text{em-tr}_{gmt}$ | Amount of greenhouse gas $g$ released by transporting 1 tonne of material $m$ over one km at time $t$ | tonne/km-tonne |
|
||||
| $K^\text{mix}_{pmt}$ | If plant $p$ receives one tonne of input material at time $t$, then $K^\text{mix}_{pmt}$ is the amount of product $m$ in this mix. Must be between zero and one, and the sum of these amounts must equal to one. | tonne |
|
||||
| $K^\text{out-fix}_{cmt}$ | Fixed amount of material $m$ collected at center $c$ at time $t$ | tonne |
|
||||
| $K^\text{out-var-len}_{cm}$ | Length of the $K^\text{out-var}_{c,m,*}$ vector. | -- |
|
||||
| $K^\text{out-var}_{cmi}$ | Factor used to calculate variable amount of material $m$ collected at center $c$. See `eq_z_collected` for more details. | -- |
|
||||
| $K^\text{output}_{pmt}$ | Amount of material $m$ produced by plant $p$ at time $t$ for each tonne of input material processed | tonne |
|
||||
| $R^\text{collect}_{cmt}$ | Cost of collecting material $m$ at center $c$ at time $t$ | \$/tonne |
|
||||
| $R^\text{disp}_{umt}$ | Cost to dispose of material at plant/center $u$ at time $t$ | \$/tonne |
|
||||
| $R^\text{em}_{gt}$ | Penalty cost per tonne of greenhouse gas $g$ emitted at time $t$ | \$/tonne |
|
||||
| $R^\text{expand}_{pt}$ | Cost to increase capacity of plant $p$ at time $t$ | \$/tonne |
|
||||
| $R^\text{fix}_{ct}$ | Fixed operating cost for center $c$ at time $t$ | \$ |
|
||||
| $R^\text{fix-min}_{pt}$ | Fixed operating cost for plant $p$ at time $t$ at minimum capacity | \$ |
|
||||
| $R^\text{fix-exp}_{pt}$ | Increase in fixed operational cost for plant $p$ at time $t$ for every additional tonne of capacity | \$/tonne |
|
||||
| $R^\text{open}_{pt}$ | Cost to open plant $p$ at time $t$, at minimum capacity | \$ |
|
||||
| $R^\text{rev}_{ct}$ | Revenue for selling the input product of center $c$ at this center at time $t$ | \$/tonne |
|
||||
| $R^\text{tr}_{mt}$ | Cost to send material $m$ at time $t$ | \$/km-tonne |
|
||||
| $R^\text{var}_{pt}$ | Cost to process one tonne of input material at plant $p$ at time $t$ | \$/tonne |
|
||||
| Symbol | Description | Unit |
|
||||
| :---------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- |
|
||||
| $K^{\text{dist}}_{uv}$ | Distance between plants/centers $u$ and $v$ | km |
|
||||
| $K^\text{cap-init}_p$ | Initial capacity of plant $p$ | tonne |
|
||||
| $K^\text{cap-max}_p$ | Maximum capacity of plant $p$ | tonne |
|
||||
| $K^\text{cap-min}_p$ | Minimum capacity of plant $p$ | tonne |
|
||||
| $K^\text{disp-limit}_{mt}$ | Maximum amount of material $m$ that can be disposed of (globally) at time $t$ | tonne |
|
||||
| $K^\text{disp-limit}_{mut}$ | Maximum amount of material $m$ that can be disposed of at plant/center $u$ at time $t$ | tonne |
|
||||
| $K^\text{em-limit}_{gt}$ | Maximum amount of greenhouse gas $g$ allowed to be emitted (globally) at time $t$ | tonne |
|
||||
| $K^\text{em-plant}_{gpt}$ | Amount of greenhouse gas $g$ released by plant $p$ at time $t$ for each tonne of input material processed | tonne/tonne |
|
||||
| $K^\text{em-tr}_{gmt}$ | Amount of greenhouse gas $g$ released by transporting 1 tonne of material $m$ over one km at time $t$ | tonne/km-tonne |
|
||||
| $K^\text{mix}_{pmt}$ | If plant $p$ receives one tonne of input material at time $t$, then $K^\text{mix}_{pmt}$ is the amount of product $m$ in this mix. Must be between zero and one, and the sum of these amounts must equal to one. | tonne |
|
||||
| $K^\text{out-fix}_{cmt}$ | Fixed amount of material $m$ collected at center $c$ at time $t$ | tonne |
|
||||
| $K^\text{out-var-len}_{cm}$ | Length of the $K^\text{out-var}_{c,m,*}$ vector. | -- |
|
||||
| $K^\text{out-var}_{cmi}$ | Factor used to calculate variable amount of material $m$ collected at center $c$. See `eq_z_collected` for more details. | -- |
|
||||
| $K^\text{output}_{pmt}$ | Amount of material $m$ produced by plant $p$ at time $t$ for each tonne of input material processed | tonne |
|
||||
| $K^\text{storage-limit}_{pm}$ | Maximum amount of material $m$ that can be stored at plant $p$ at any time | tonne |
|
||||
| $R^\text{collect}_{cmt}$ | Cost of collecting material $m$ at center $c$ at time $t$ | \$/tonne |
|
||||
| $R^\text{disp}_{umt}$ | Cost to dispose of material at plant/center $u$ at time $t$ | \$/tonne |
|
||||
| $R^\text{em}_{gt}$ | Penalty cost per tonne of greenhouse gas $g$ emitted at time $t$ | \$/tonne |
|
||||
| $R^\text{expand}_{pt}$ | Cost to increase capacity of plant $p$ at time $t$ | \$/tonne |
|
||||
| $R^\text{fix-exp}_{pt}$ | Increase in fixed operational cost for plant $p$ at time $t$ for every additional tonne of capacity | \$/tonne |
|
||||
| $R^\text{fix-min}_{pt}$ | Fixed operating cost for plant $p$ at time $t$ at minimum capacity | \$ |
|
||||
| $R^\text{fix}_{ct}$ | Fixed operating cost for center $c$ at time $t$ | \$ |
|
||||
| $R^\text{open}_{pt}$ | Cost to open plant $p$ at time $t$, at minimum capacity | \$ |
|
||||
| $R^\text{rev}_{ct}$ | Revenue for selling the input product of center $c$ at this center at time $t$ | \$/tonne |
|
||||
| $R^\text{storage}_{pmt}$ | Cost to store one tonne of material $m$ at plant $p$ at time $t$ for one year | \$/tonne |
|
||||
| $R^\text{tr}_{mt}$ | Cost to send material $m$ at time $t$ | \$/km-tonne |
|
||||
| $R^\text{var}_{pt}$ | Cost to process one tonne of input material at plant $p$ at time $t$ | \$/tonne |
|
||||
|
||||
## Decision variables
|
||||
|
||||
@@ -88,8 +90,10 @@ The mathematical model employed by RELOG is based on three main components:
|
||||
| $z^{\text{disp}}_{umt}$ | `z_disp[u.name, m.name, t]` | Amount of product $m$ disposed of at plant/center $u$ at time $t$ | tonne |
|
||||
| $z^{\text{em-plant}}_{gpt}$ | `z_em_plant[g.name, p.name, t]` | Amount of greenhouse gas $g$ released by plant $p$ at time $t$ | tonne |
|
||||
| $z^{\text{em-tr}}_{guvmt}$ | `z_em_tr[g.name, u.name, v.name, m.name, t]` | Amount of greenhouse gas $g$ released at time $t$ due to transportation of material $m$ from $u$ to $v$ | tonne |
|
||||
| $z^{\text{input}}_{ut}$ | `z_input[u.name, t]` | Total plant/center input at time $t$ | tonne |
|
||||
| $z^{\text{input}}_{ut}$ | `z_input[u.name, t]` | Total amount received by plant/center $u$ at time $t$ | tonne |
|
||||
| $z^{\text{prod}}_{umt}$ | `z_prod[u.name, m.name, t]` | Amount of product $m$ produced by plant/center $u$ at time $t$ | tonne |
|
||||
| $z^{\text{storage}}_{pmt}$ | `z_storage[p.name, m.name, t]` | Amount of input material $m$ stored at plant $p$ at the end of time $t$ | tonne |
|
||||
| $z^{\text{process}}_{pt}$ | `z_process[p.name, t]` | Total amount of input material processed by plant $p$ at time $t$ | tonne |
|
||||
|
||||
## Objective function
|
||||
|
||||
@@ -171,6 +175,12 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
\sum_{p \in P} \sum_{(u,m) \in E^-(p)} \sum_{t \in T} R^\text{var}_{pt} y_{upmt}
|
||||
```
|
||||
|
||||
- Plant storage cost, incurred for each tonne of material stored at the plant:
|
||||
|
||||
```math
|
||||
\sum_{p \in P} \sum_{m \in M^-_p} \sum_{t \in T} R^\text{storage}_{pmt} z^{\text{storage}}_{pmt}
|
||||
```
|
||||
|
||||
- Emissions penalty cost, incurred for each tonne of greenhouse gas emitted:
|
||||
|
||||
```math
|
||||
@@ -190,13 +200,22 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Plant input mix must have correct proportion
|
||||
(`eq_input_mix[p.name, m.name, t]`):
|
||||
- Definition of plant processing (`eq_z_process[p.name, t]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& \sum_{u : (u,m) \in E^-(p)} y_{upmt}
|
||||
= K^\text{mix}_{pmt} z^{\text{input}}_{pt}
|
||||
& z^{\text{process}}_{pt} = z^{\text{input}}_{pt} + \sum_{m \in M^-_p} \left(z^{\text{storage}}_{p,m,t-1} - z^{\text{storage}}_{pmt}\right)
|
||||
& \forall p \in P, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Plant processing mix must have correct proportion
|
||||
(`eq_process_mix[p.name, m.name, t]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& \sum_{u : (u,m) \in E^-(p)} y_{upmt} + z^{\text{storage}}_{p,m,t-1} - z^{\text{storage}}_{pmt}
|
||||
= K^\text{mix}_{pmt} z^{\text{process}}_{pt}
|
||||
& \forall p \in P, m \in M^-_p, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
@@ -205,7 +224,7 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^\text{prod}_{pmt} = K^\text{output}_{pmt} z^\text{input}_{pt}
|
||||
& z^\text{prod}_{pmt} = K^\text{output}_{pmt} z^{\text{process}}_{pt}
|
||||
& \forall p \in P, m \in M^+_p, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
@@ -220,7 +239,8 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Plant can only be expanded if the plant is open, and up to a certain amount (`eq_exp_ub[p.name, t]`):
|
||||
- Plant can only be expanded if the plant is open, and up to a certain amount
|
||||
(`eq_exp_ub[p.name, t]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
@@ -251,15 +271,24 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
```
|
||||
|
||||
- Plants cannot process more than their current capacity
|
||||
(`eq_input_limit[p.name,t]`)
|
||||
(`eq_process_limit[p.name,t]`)
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^\text{input}_{pt} \leq K^\text{cap-min}_p x_{pt} + z^\text{exp}_{pt}
|
||||
& z^\text{process}_{pt} \leq K^\text{cap-min}_p x_{pt} + z^\text{exp}_{pt}
|
||||
& \forall p \in P, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Storage limit at the plants (`eq_storage_limit[p.name, m.name, t]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^{\text{storage}}_{pmt} \leq K^\text{storage-limit}_{pm}
|
||||
& \forall p \in P, m \in M^-_p, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Disposal limit at the plants (`eq_disposal_limit[p.name, m.name, t]`):
|
||||
|
||||
```math
|
||||
@@ -343,7 +372,7 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^{\text{em-plant}}_{gpt} = K^\text{em-plant}_{gpt} z^{\text{input}}_{pt}
|
||||
& z^{\text{em-plant}}_{gpt} = K^\text{em-plant}_{gpt} z^{\text{process}}_{pt}
|
||||
& \forall g \in G, p \in P, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
@@ -356,3 +385,22 @@ The goal is to minimize a linear objective function with the following terms:
|
||||
& \forall g \in G, t \in T
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- All stored materials must be processed by the end of the time horizon
|
||||
(`eq_storage_final[p.name, m.name]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^{\text{storage}}_{p,m,t^{max}} = 0
|
||||
& \forall p \in P, m \in M^-_p
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
- Initial storage is zero (`eq_storage_initial[p.name, m.name]`):
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
& z^{\text{storage}}_{p,m,0} = 0
|
||||
& \forall p \in P, m \in M^-_p
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
module RELOG
|
||||
|
||||
_round(x::Number) = round(x, digits = 5)
|
||||
function _round(x::Number)
|
||||
if abs(x) < 1e-5
|
||||
return 0
|
||||
else
|
||||
return round(x, digits = 5)
|
||||
end
|
||||
end
|
||||
|
||||
include("instance/structs.jl")
|
||||
include("instance/parse.jl")
|
||||
|
||||
@@ -148,6 +148,23 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
z_collected[c.name, m.name, t] = @variable(model, lower_bound = 0)
|
||||
end
|
||||
|
||||
# Amount of input material stored at plant at end of time period
|
||||
z_storage = _init(model, :z_storage)
|
||||
for p in plants
|
||||
for m in keys(p.input_mix)
|
||||
z_storage[p.name, m.name, 0] = 0 # Initial storage is zero
|
||||
end
|
||||
end
|
||||
for p in plants, m in keys(p.input_mix), t in T
|
||||
z_storage[p.name, m.name, t] = @variable(model, lower_bound = 0)
|
||||
end
|
||||
|
||||
# Total amount of input material processed by plant
|
||||
z_process = _init(model, :z_process)
|
||||
for p in plants, t in T
|
||||
z_process[p.name, t] = @variable(model, lower_bound = 0)
|
||||
end
|
||||
|
||||
# Transportation emissions by greenhouse gas
|
||||
z_em_tr = _init(model, :z_em_tr)
|
||||
for (p1, p2, m) in E, t in T, g in keys(m.tr_emissions)
|
||||
@@ -224,6 +241,11 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
)
|
||||
end
|
||||
|
||||
# Plants: Storage cost
|
||||
for p in plants, m in keys(p.storage_cost), t in T
|
||||
add_to_expression!(obj, p.storage_cost[m][t], z_storage[p.name, m.name, t])
|
||||
end
|
||||
|
||||
# Emissions penalty cost
|
||||
for emission in instance.emissions, t in T
|
||||
# Plant emissions penalty
|
||||
@@ -263,13 +285,27 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
)
|
||||
end
|
||||
|
||||
# Plants: Must meet input mix
|
||||
eq_input_mix = _init(model, :eq_input_mix)
|
||||
for p in plants, m in keys(p.input_mix), t in T
|
||||
eq_input_mix[p.name, m.name, t] = @constraint(
|
||||
# Plants: Definition of total processing amount
|
||||
eq_z_process = _init(model, :eq_z_process)
|
||||
for p in plants, t in T
|
||||
eq_z_process[p.name, t] = @constraint(
|
||||
model,
|
||||
sum(y[src.name, p.name, m.name, t] for (src, m2) in E_in[p] if m == m2) ==
|
||||
z_input[p.name, t] * p.input_mix[m][t]
|
||||
z_process[p.name, t] == z_input[p.name, t] +
|
||||
sum(
|
||||
z_storage[p.name, m.name, t-1] - z_storage[p.name, m.name, t]
|
||||
for m in keys(p.input_mix)
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
# Plants: Processing mix must have correct proportion
|
||||
eq_process_mix = _init(model, :eq_process_mix)
|
||||
for p in plants, m in keys(p.input_mix), t in T
|
||||
eq_process_mix[p.name, m.name, t] = @constraint(
|
||||
model,
|
||||
sum(y[src.name, p.name, m.name, t] for (src, m2) in E_in[p] if m == m2) +
|
||||
z_storage[p.name, m.name, t-1] - z_storage[p.name, m.name, t] ==
|
||||
z_process[p.name, t] * p.input_mix[m][t]
|
||||
)
|
||||
end
|
||||
|
||||
@@ -278,7 +314,7 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
for p in plants, m in keys(p.output), t in T
|
||||
eq_z_prod[p.name, m.name, t] = @constraint(
|
||||
model,
|
||||
z_prod[p.name, m.name, t] == z_input[p.name, t] * p.output[m][t]
|
||||
z_prod[p.name, m.name, t] == z_process[p.name, t] * p.output[m][t]
|
||||
)
|
||||
end
|
||||
|
||||
@@ -302,12 +338,12 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
)
|
||||
end
|
||||
|
||||
# Plants: Input limit
|
||||
eq_input_limit = _init(model, :eq_input_limit)
|
||||
# Plants: Processing limit
|
||||
eq_process_limit = _init(model, :eq_process_limit)
|
||||
for p in plants, t in T
|
||||
eq_input_limit[p.name, t] = @constraint(
|
||||
eq_process_limit[p.name, t] = @constraint(
|
||||
model,
|
||||
z_input[p.name, t] <= K_cap_min[p] * x[p.name, t] + z_exp[p.name, t]
|
||||
z_process[p.name, t] <= K_cap_min[p] * x[p.name, t] + z_exp[p.name, t]
|
||||
)
|
||||
end
|
||||
|
||||
@@ -404,7 +440,27 @@ function build_model(instance::Instance; optimizer, variable_names::Bool = false
|
||||
for p in plants, t in T, g in keys(p.emissions)
|
||||
eq_emission_plant[g, p.name, t] = @constraint(
|
||||
model,
|
||||
z_em_plant[g, p.name, t] == p.emissions[g][t] * z_input[p.name, t]
|
||||
z_em_plant[g, p.name, t] == p.emissions[g][t] * z_process[p.name, t]
|
||||
)
|
||||
end
|
||||
|
||||
# Storage limit at plants
|
||||
eq_storage_limit = _init(model, :eq_storage_limit)
|
||||
for p in plants, m in keys(p.storage_limit), t in T
|
||||
if isfinite(p.storage_limit[m][t])
|
||||
eq_storage_limit[p.name, m.name, t] = @constraint(
|
||||
model,
|
||||
z_storage[p.name, m.name, t] <= p.storage_limit[m][t]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# All stored materials must be processed by end of time horizon
|
||||
eq_storage_final = _init(model, :eq_storage_final)
|
||||
for p in plants, m in keys(p.input_mix)
|
||||
eq_storage_final[p.name, m.name] = @constraint(
|
||||
model,
|
||||
z_storage[p.name, m.name, instance.time_horizon] == 0
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -15,10 +15,13 @@ function plants_report(model)::DataFrame
|
||||
df."year" = Int[]
|
||||
df."operational?" = Bool[]
|
||||
df."input amount (tonne)" = Float64[]
|
||||
df."stored amount (tonne)" = Float64[]
|
||||
df."processed amount (tonne)" = Float64[]
|
||||
df."opening cost (\$)" = Float64[]
|
||||
df."fixed operating cost (\$)" = Float64[]
|
||||
df."variable operating cost (\$)" = Float64[]
|
||||
df."expansion cost (\$)" = Float64[]
|
||||
df."storage cost (\$)" = Float64[]
|
||||
|
||||
plants = model.ext[:instance].plants
|
||||
T = 1:model.ext[:instance].time_horizon
|
||||
@@ -26,6 +29,17 @@ function plants_report(model)::DataFrame
|
||||
for p in plants, t in T
|
||||
operational = JuMP.value(model[:x][p.name, t]) > 0.5
|
||||
input = value(model[:z_input][p.name, t])
|
||||
processed = value(model[:z_process][p.name, t])
|
||||
|
||||
# Calculate total stored amount across all input materials
|
||||
stored = sum(value(model[:z_storage][p.name, m.name, t]) for m in keys(p.input_mix))
|
||||
|
||||
# Calculate total storage cost
|
||||
storage_cost = sum(
|
||||
p.storage_cost[m][t] * value(model[:z_storage][p.name, m.name, t])
|
||||
for m in keys(p.storage_cost)
|
||||
)
|
||||
|
||||
var_operating_cost = input * p.capacities[1].var_operating_cost[t]
|
||||
opening_cost = 0
|
||||
curr_capacity = 0
|
||||
@@ -56,10 +70,53 @@ function plants_report(model)::DataFrame
|
||||
"year" => t,
|
||||
"operational?" => operational,
|
||||
"input amount (tonne)" => _round(input),
|
||||
"stored amount (tonne)" => _round(stored),
|
||||
"processed amount (tonne)" => _round(processed),
|
||||
"opening cost (\$)" => _round(opening_cost),
|
||||
"fixed operating cost (\$)" => _round(fix_operating_cost),
|
||||
"variable operating cost (\$)" => _round(var_operating_cost),
|
||||
"expansion cost (\$)" => _round(expansion_cost),
|
||||
"storage cost (\$)" => _round(storage_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
end
|
||||
|
||||
function plant_inputs_report(model)::DataFrame
|
||||
df = DataFrame()
|
||||
df."plant" = String[]
|
||||
df."latitude" = Float64[]
|
||||
df."longitude" = Float64[]
|
||||
df."input product" = String[]
|
||||
df."year" = Int[]
|
||||
df."amount received (tonne)" = Float64[]
|
||||
df."current storage level (tonne)" = Float64[]
|
||||
df."storage limit (tonne)" = Float64[]
|
||||
df."storage cost (\$)" = Float64[]
|
||||
|
||||
plants = model.ext[:instance].plants
|
||||
T = 1:model.ext[:instance].time_horizon
|
||||
|
||||
for p in plants, m in keys(p.input_mix), t in T
|
||||
amount_received = sum(
|
||||
value(model[:y][src.name, p.name, m.name, t])
|
||||
for (src, prod) in model.ext[:E_in][p] if prod == m
|
||||
)
|
||||
storage_level = value(model[:z_storage][p.name, m.name, t])
|
||||
storage_cost = p.storage_cost[m][t] * storage_level
|
||||
push!(
|
||||
df,
|
||||
Dict(
|
||||
"plant" => p.name,
|
||||
"latitude" => p.latitude,
|
||||
"longitude" => p.longitude,
|
||||
"input product" => m.name,
|
||||
"year" => t,
|
||||
"amount received (tonne)" => _round(amount_received),
|
||||
"current storage level (tonne)" => _round(storage_level),
|
||||
"storage limit (tonne)" => _round(p.storage_limit[m][t]),
|
||||
"storage cost (\$)" => _round(storage_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
@@ -110,7 +167,7 @@ function plant_emissions_report(model)::DataFrame
|
||||
df."longitude" = Float64[]
|
||||
df."emission" = String[]
|
||||
df."year" = Int[]
|
||||
df."input amount (tonne)" = Float64[]
|
||||
df."processed amount (tonne)" = Float64[]
|
||||
df."emission factor (tonne/tonne)" = Float64[]
|
||||
df."emissions amount (tonne)" = Float64[]
|
||||
|
||||
@@ -118,8 +175,8 @@ function plant_emissions_report(model)::DataFrame
|
||||
T = 1:model.ext[:instance].time_horizon
|
||||
|
||||
for p in plants, t in T, g in keys(p.emissions)
|
||||
input_amount = JuMP.value(model[:z_input][p.name, t])
|
||||
input_amount > 1e-3 || continue
|
||||
processed_amount = JuMP.value(model[:z_process][p.name, t])
|
||||
processed_amount > 1e-3 || continue
|
||||
emissions = JuMP.value(model[:z_em_plant][g, p.name, t])
|
||||
emission_factor = p.emissions[g][t]
|
||||
push!(
|
||||
@@ -130,7 +187,7 @@ function plant_emissions_report(model)::DataFrame
|
||||
"longitude" => p.longitude,
|
||||
"emission" => g,
|
||||
"year" => t,
|
||||
"input amount (tonne)" => _round(input_amount),
|
||||
"processed amount (tonne)" => _round(processed_amount),
|
||||
"emission factor (tonne/tonne)" => _round(emission_factor),
|
||||
"emissions amount (tonne)" => _round(emissions),
|
||||
),
|
||||
@@ -140,6 +197,7 @@ function plant_emissions_report(model)::DataFrame
|
||||
end
|
||||
|
||||
write_plants_report(solution, filename) = CSV.write(filename, plants_report(solution))
|
||||
write_plant_inputs_report(solution, filename) = CSV.write(filename, plant_inputs_report(solution))
|
||||
write_plant_outputs_report(solution, filename) =
|
||||
CSV.write(filename, plant_outputs_report(solution))
|
||||
write_plant_emissions_report(solution, filename) =
|
||||
|
||||
1
test/fixtures/boat_example.jl
vendored
1
test/fixtures/boat_example.jl
vendored
@@ -173,6 +173,7 @@ function run_boat_example()
|
||||
mkpath(fixture("boat_example"))
|
||||
write_to_file(model, fixture("boat_example/model.lp"))
|
||||
RELOG.write_plants_report(model, fixture("boat_example/plants.csv"))
|
||||
RELOG.write_plant_inputs_report(model, fixture("boat_example/plant_inputs.csv"))
|
||||
RELOG.write_plant_outputs_report(model, fixture("boat_example/plant_outputs.csv"))
|
||||
RELOG.write_plant_emissions_report(model, fixture("boat_example/plant_emissions.csv"))
|
||||
RELOG.write_centers_report(model, fixture("boat_example/centers.csv"))
|
||||
|
||||
@@ -45,9 +45,9 @@ Retail (Los Angeles),34.052235,-118.243683,UsedBoat,3,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Los Angeles),34.052235,-118.243683,UsedBoat,4,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Los Angeles),34.052235,-118.243683,UsedBoat,5,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,1,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,2,-0.0,0.0,0.0,-0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,3,-0.0,0.0,0.0,-0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,4,-0.0,0.0,0.0,-0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,2,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,3,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,4,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Houston),29.760427,-95.369804,UsedBoat,5,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Phoenix),33.448376,-112.074036,UsedBoat,1,0.0,0.0,0.0,0.0,0.0
|
||||
Retail (Phoenix),33.448376,-112.074036,UsedBoat,2,0.0,0.0,0.0,0.0,0.0
|
||||
|
||||
|
2
test/fixtures/boat_example/centers.csv
vendored
2
test/fixtures/boat_example/centers.csv
vendored
@@ -45,7 +45,7 @@ Retail (Los Angeles),34.052235,-118.243683,3,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Los Angeles),34.052235,-118.243683,4,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Los Angeles),34.052235,-118.243683,5,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,1,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,2,NewBoat,-0.0,-0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,2,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,3,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,4,NewBoat,0.0,0.0,125000.0
|
||||
Retail (Houston),29.760427,-95.369804,5,NewBoat,0.0,0.0,125000.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
plant,latitude,longitude,emission,year,input amount (tonne),emission factor (tonne/tonne),emissions amount (tonne)
|
||||
plant,latitude,longitude,emission,year,processed amount (tonne),emission factor (tonne/tonne),emissions amount (tonne)
|
||||
BoatFactory (Dallas),32.776664,-96.796988,CO2,1,63.15789,5.0,315.78947
|
||||
BoatFactory (Dallas),32.776664,-96.796988,CO2,2,71.46814,5.0,357.34072
|
||||
BoatFactory (Dallas),32.776664,-96.796988,CO2,3,75.8857,5.0,379.42849
|
||||
|
||||
|
151
test/fixtures/boat_example/plant_inputs.csv
vendored
Normal file
151
test/fixtures/boat_example/plant_inputs.csv
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
plant,latitude,longitude,input product,year,amount received (tonne),current storage level (tonne),storage limit (tonne),storage cost ($)
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,Nail,5,0.0,0.0,1.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Wood,1,60.0,0.0,5.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Wood,2,67.89474,0.0,5.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Wood,3,72.09141,0.0,5.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Wood,4,73.05912,0.0,5.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Wood,5,73.40733,0.0,5.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Nail,1,3.15789,0.0,1.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Nail,2,3.57341,0.0,1.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Nail,3,3.79428,0.0,1.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Nail,4,3.84522,0.0,1.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,Nail,5,3.86354,0.0,1.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Wood,1,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Wood,2,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Wood,3,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Wood,4,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Wood,5,0.0,0.0,5.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Nail,1,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Nail,2,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Nail,3,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Nail,4,0.0,0.0,1.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,Nail,5,0.0,0.0,1.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,UsedBoat,1,6.31579,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,UsedBoat,2,22.93629,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,UsedBoat,3,31.7714,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,UsedBoat,4,33.80867,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,UsedBoat,5,34.54174,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,UsedBoat,1,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,UsedBoat,2,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,UsedBoat,3,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,UsedBoat,4,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,UsedBoat,5,0.0,0.0,0.0,0.0
|
||||
|
202
test/fixtures/boat_example/plants.csv
vendored
202
test/fixtures/boat_example/plants.csv
vendored
@@ -1,101 +1,101 @@
|
||||
plant,latitude,longitude,initial capacity,current capacity,year,operational?,input amount (tonne),opening cost ($),fixed operating cost ($),variable operating cost ($),expansion cost ($)
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,1,true,63.15789,100000.0,250000.0,315.78947,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,2,true,71.46814,0.0,250000.0,357.34072,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,3,true,75.8857,0.0,250000.0,379.42849,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,4,true,76.90434,0.0,250000.0,384.52168,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,5,true,77.27087,0.0,250000.0,386.35435,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,1,true,6.31579,500000.0,125000.0,15.78947,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,2,true,22.93629,0.0,125000.0,57.34072,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,3,true,31.7714,0.0,125000.0,79.42849,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,4,true,33.80867,0.0,125000.0,84.52168,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,5,true,34.54174,0.0,125000.0,86.35435,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0
|
||||
plant,latitude,longitude,initial capacity,current capacity,year,operational?,input amount (tonne),stored amount (tonne),processed amount (tonne),opening cost ($),fixed operating cost ($),variable operating cost ($),expansion cost ($),storage cost ($)
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Chicago),41.881832,-87.623177,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (New York City),40.712776,-74.005974,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Los Angeles),34.052235,-118.243683,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Houston),29.760427,-95.369804,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Phoenix),33.448376,-112.074036,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Philadelphia),39.952583,-75.165222,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Antonio),29.424122,-98.493629,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Diego),32.715736,-117.161087,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,1,true,63.15789,0.0,63.15789,100000.0,250000.0,315.78947,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,2,true,71.46814,0.0,71.46814,0.0,250000.0,357.34072,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,3,true,75.8857,0.0,75.8857,0.0,250000.0,379.42849,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,4,true,76.90434,0.0,76.90434,0.0,250000.0,384.52168,0.0,0.0
|
||||
BoatFactory (Dallas),32.776664,-96.796988,0.0,500.0,5,true,77.27087,0.0,77.27087,0.0,250000.0,386.35435,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
BoatFactory (San Jose),37.338208,-121.886329,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Chicago),41.881832,-87.623177,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (New York City),40.712776,-74.005974,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Los Angeles),34.052235,-118.243683,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Houston),29.760427,-95.369804,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Phoenix),33.448376,-112.074036,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Philadelphia),39.952583,-75.165222,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Antonio),29.424122,-98.493629,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Diego),32.715736,-117.161087,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,1,true,6.31579,0.0,6.31579,500000.0,125000.0,15.78947,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,2,true,22.93629,0.0,22.93629,0.0,125000.0,57.34072,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,3,true,31.7714,0.0,31.7714,0.0,125000.0,79.42849,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,4,true,33.80867,0.0,33.80867,0.0,125000.0,84.52168,0.0,0.0
|
||||
RecyclingPlant (Dallas),32.776664,-96.796988,0.0,500.0,5,true,34.54174,0.0,34.54174,0.0,125000.0,86.35435,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,1,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,2,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,3,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,4,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
RecyclingPlant (San Jose),37.338208,-121.886329,0.0,0.0,5,false,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
|
||||
|
||||
|
@@ -9,6 +9,8 @@ function model_build_test()
|
||||
y = model[:y]
|
||||
z_disp = model[:z_disp]
|
||||
z_input = model[:z_input]
|
||||
z_process = model[:z_process]
|
||||
z_storage = model[:z_storage]
|
||||
z_em_tr = model[:z_em_tr]
|
||||
z_em_plant = model[:z_em_plant]
|
||||
z_exp = model[:z_exp]
|
||||
@@ -66,6 +68,10 @@ function model_build_test()
|
||||
+ 0.25 # fixed operating cost[1]
|
||||
)
|
||||
|
||||
# Test storage cost in objective function
|
||||
@test obj.terms[z_storage["L1", "P1", 1]] == 0.1 # P1 storage cost
|
||||
@test obj.terms[z_storage["L1", "P2", 1]] == 0.1 # P2 storage cost
|
||||
|
||||
# Variables: Transportation emissions
|
||||
@test haskey(z_em_tr, ("CO2", "L1", "C3", "P4", 1))
|
||||
@test haskey(z_em_tr, ("CH4", "L1", "C3", "P4", 1))
|
||||
@@ -82,17 +88,21 @@ function model_build_test()
|
||||
@test repr(model[:eq_z_input]["L1", 1]) ==
|
||||
"eq_z_input[L1,1] : -y[C2,L1,P1,1] - y[C1,L1,P2,1] + z_input[L1,1] = 0"
|
||||
|
||||
# Plants: Must meet input mix
|
||||
@test repr(model[:eq_input_mix]["L1", "P1", 1]) ==
|
||||
"eq_input_mix[L1,P1,1] : y[C2,L1,P1,1] - 0.953 z_input[L1,1] = 0"
|
||||
@test repr(model[:eq_input_mix]["L1", "P2", 1]) ==
|
||||
"eq_input_mix[L1,P2,1] : y[C1,L1,P2,1] - 0.047 z_input[L1,1] = 0"
|
||||
# Plants: Definition of total processing amount
|
||||
@test repr(model[:eq_z_process]["L1", 1]) ==
|
||||
"eq_z_process[L1,1] : -z_input[L1,1] + z_storage[L1,P1,1] + z_storage[L1,P2,1] + z_process[L1,1] = 0"
|
||||
|
||||
# Plants: Processing mix must have correct proportion
|
||||
@test repr(model[:eq_process_mix]["L1", "P1", 1]) ==
|
||||
"eq_process_mix[L1,P1,1] : y[C2,L1,P1,1] - z_storage[L1,P1,1] - 0.953 z_process[L1,1] = 0"
|
||||
@test repr(model[:eq_process_mix]["L1", "P2", 1]) ==
|
||||
"eq_process_mix[L1,P2,1] : y[C1,L1,P2,1] - z_storage[L1,P2,1] - 0.047 z_process[L1,1] = 0"
|
||||
|
||||
# Plants: Calculate amount produced
|
||||
@test repr(model[:eq_z_prod]["L1", "P3", 1]) ==
|
||||
"eq_z_prod[L1,P3,1] : z_prod[L1,P3,1] - 0.25 z_input[L1,1] = 0"
|
||||
"eq_z_prod[L1,P3,1] : z_prod[L1,P3,1] - 0.25 z_process[L1,1] = 0"
|
||||
@test repr(model[:eq_z_prod]["L1", "P4", 1]) ==
|
||||
"eq_z_prod[L1,P4,1] : z_prod[L1,P4,1] - 0.12 z_input[L1,1] = 0"
|
||||
"eq_z_prod[L1,P4,1] : z_prod[L1,P4,1] - 0.12 z_process[L1,1] = 0"
|
||||
|
||||
# Plants: Produced material must be sent or disposed
|
||||
@test repr(model[:eq_balance]["L1", "P3", 1]) ==
|
||||
@@ -100,9 +110,9 @@ function model_build_test()
|
||||
@test repr(model[:eq_balance]["L1", "P4", 1]) ==
|
||||
"eq_balance[L1,P4,1] : -y[L1,C3,P4,1] + z_prod[L1,P4,1] - z_disp[L1,P4,1] = 0"
|
||||
|
||||
# Plants: Input limit (capacity constraint)
|
||||
@test repr(model[:eq_input_limit]["L1", 1]) ==
|
||||
"eq_input_limit[L1,1] : -100 x[L1,1] + z_input[L1,1] - z_exp[L1,1] ≤ 0"
|
||||
# Plants: Processing limit (capacity constraint)
|
||||
@test repr(model[:eq_process_limit]["L1", 1]) ==
|
||||
"eq_process_limit[L1,1] : -100 x[L1,1] - z_exp[L1,1] + z_process[L1,1] ≤ 0"
|
||||
|
||||
# Plants: Expansion upper bound
|
||||
@test repr(model[:eq_exp_ub]["L1", 1]) ==
|
||||
@@ -161,9 +171,9 @@ function model_build_test()
|
||||
@test repr(model[:eq_emission_tr]["CH4", "L1", "C3", "P4", 1]) ==
|
||||
"eq_emission_tr[CH4,L1,C3,P4,1] : -0.333354 y[L1,C3,P4,1] + z_em_tr[CH4,L1,C3,P4,1] = 0"
|
||||
|
||||
# Plants: Plant emissions (updated to use z_input)
|
||||
# Plants: Plant emissions (updated to use z_process)
|
||||
@test repr(model[:eq_emission_plant]["CO2", "L1", 1]) ==
|
||||
"eq_emission_plant[CO2,L1,1] : -0.1 z_input[L1,1] + z_em_plant[CO2,L1,1] = 0"
|
||||
"eq_emission_plant[CO2,L1,1] : -0.1 z_process[L1,1] + z_em_plant[CO2,L1,1] = 0"
|
||||
|
||||
# Objective function: Emissions penalty costs
|
||||
@test obj.terms[z_em_plant["CO2", "L1", 1]] == 50.0 # CO2 penalty at time 1
|
||||
@@ -177,4 +187,30 @@ function model_build_test()
|
||||
@test repr(model[:eq_emission_limit]["CO2", 1]) ==
|
||||
"eq_emission_limit[CO2,1] : z_em_tr[CO2,C2,L1,P1,1] + z_em_tr[CO2,C2,C1,P1,1] + z_em_tr[CO2,C1,L1,P2,1] + z_em_tr[CO2,L1,C3,P4,1] + z_em_plant[CO2,L1,1] ≤ 1000"
|
||||
@test ("CH4", 1) ∉ keys(model[:eq_emission_limit])
|
||||
|
||||
# Test storage variables exist
|
||||
@test haskey(z_storage, ("L1", "P1", 1))
|
||||
@test haskey(z_storage, ("L1", "P2", 1))
|
||||
@test haskey(z_process, ("L1", 1))
|
||||
@test haskey(z_process, ("L1", 2))
|
||||
@test haskey(z_process, ("L1", 3))
|
||||
@test haskey(z_process, ("L1", 4))
|
||||
|
||||
# Test initial storage values
|
||||
@test z_storage["L1", "P1", 0] == 0
|
||||
@test z_storage["L1", "P2", 0] == 0
|
||||
|
||||
# Test storage limit constraints (P1 has limit of 100, P2 has no limit)
|
||||
@test haskey(model[:eq_storage_limit], ("L1", "P1", 1))
|
||||
@test repr(model[:eq_storage_limit]["L1", "P1", 1]) ==
|
||||
"eq_storage_limit[L1,P1,1] : z_storage[L1,P1,1] ≤ 100"
|
||||
@test ("L1", "P2", 1) ∉ keys(model[:eq_storage_limit]) # P2 has no storage limit
|
||||
|
||||
# Test final storage constraints exist
|
||||
@test haskey(model[:eq_storage_final], ("L1", "P1"))
|
||||
@test haskey(model[:eq_storage_final], ("L1", "P2"))
|
||||
@test repr(model[:eq_storage_final]["L1", "P1"]) ==
|
||||
"eq_storage_final[L1,P1] : z_storage[L1,P1,4] = 0"
|
||||
@test repr(model[:eq_storage_final]["L1", "P2"]) ==
|
||||
"eq_storage_final[L1,P2] : z_storage[L1,P2,4] = 0"
|
||||
end
|
||||
|
||||
@@ -6,6 +6,7 @@ function report_tests()
|
||||
mkpath("tmp")
|
||||
write_to_file(model, "tmp/model.lp")
|
||||
RELOG.write_plants_report(model, "tmp/plants.csv")
|
||||
RELOG.write_plant_inputs_report(model, "tmp/plant_inputs.csv")
|
||||
RELOG.write_plant_outputs_report(model, "tmp/plant_outputs.csv")
|
||||
RELOG.write_centers_report(model, "tmp/centers.csv")
|
||||
RELOG.write_center_outputs_report(model, "tmp/center_outputs.csv")
|
||||
|
||||
Reference in New Issue
Block a user