mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Fix issue with collection disposal; increase precision in CSV reports
This commit is contained in:
@@ -184,8 +184,8 @@ function create_shipping_node_constraints!(model::JuMP.Model)
|
|||||||
for n in graph.collection_shipping_nodes
|
for n in graph.collection_shipping_nodes
|
||||||
model[:eq_balance][n, t] = @constraint(
|
model[:eq_balance][n, t] = @constraint(
|
||||||
model,
|
model,
|
||||||
sum(model[:flow][a, t] for a in n.outgoing_arcs) ==
|
sum(model[:flow][a, t] for a in n.outgoing_arcs) +
|
||||||
n.location.amount[t] + model[:collection_dispose][n, t]
|
model[:collection_dispose][n, t] == n.location.amount[t]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
for prod in model[:instance].products
|
for prod in model[:instance].products
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function plant_emissions_report(solution)::DataFrame
|
|||||||
location_name,
|
location_name,
|
||||||
year,
|
year,
|
||||||
emission_name,
|
emission_name,
|
||||||
round(emission_amount[year], digits = 2),
|
round(emission_amount[year], digits = 6),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function plant_outputs_report(solution)::DataFrame
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sent = round.(sent, digits = 2)
|
sent = round.(sent, digits = 6)
|
||||||
|
|
||||||
disposal_amount = zeros(T)
|
disposal_amount = zeros(T)
|
||||||
disposal_cost = zeros(T)
|
disposal_cost = zeros(T)
|
||||||
@@ -38,8 +38,8 @@ function plant_outputs_report(solution)::DataFrame
|
|||||||
disposal_amount += disposal_dict[product_name]["Amount (tonne)"]
|
disposal_amount += disposal_dict[product_name]["Amount (tonne)"]
|
||||||
disposal_cost += disposal_dict[product_name]["Cost (\$)"]
|
disposal_cost += disposal_dict[product_name]["Cost (\$)"]
|
||||||
end
|
end
|
||||||
disposal_amount = round.(disposal_amount, digits = 2)
|
disposal_amount = round.(disposal_amount, digits = 6)
|
||||||
disposal_cost = round.(disposal_cost, digits = 2)
|
disposal_cost = round.(disposal_cost, digits = 6)
|
||||||
|
|
||||||
for year = 1:T
|
for year = 1:T
|
||||||
push!(
|
push!(
|
||||||
@@ -49,7 +49,7 @@ function plant_outputs_report(solution)::DataFrame
|
|||||||
location_name,
|
location_name,
|
||||||
year,
|
year,
|
||||||
product_name,
|
product_name,
|
||||||
round(amount_produced[year], digits = 2),
|
round(amount_produced[year], digits = 6),
|
||||||
sent[year],
|
sent[year],
|
||||||
disposal_amount[year],
|
disposal_amount[year],
|
||||||
disposal_cost[year],
|
disposal_cost[year],
|
||||||
|
|||||||
@@ -28,25 +28,25 @@ function plants_report(solution)::DataFrame
|
|||||||
for (plant_name, plant_dict) in solution["Plants"]
|
for (plant_name, plant_dict) in solution["Plants"]
|
||||||
for (location_name, location_dict) in plant_dict
|
for (location_name, location_dict) in plant_dict
|
||||||
for year = 1:T
|
for year = 1:T
|
||||||
capacity = round(location_dict["Capacity (tonne)"][year], digits = 2)
|
capacity = round(location_dict["Capacity (tonne)"][year], digits = 6)
|
||||||
received = round(location_dict["Total input (tonne)"][year], digits = 2)
|
received = round(location_dict["Total input (tonne)"][year], digits = 6)
|
||||||
processed = round(location_dict["Process (tonne)"][year], digits = 2)
|
processed = round(location_dict["Process (tonne)"][year], digits = 6)
|
||||||
in_storage = round(location_dict["Storage (tonne)"][year], digits = 2)
|
in_storage = round(location_dict["Storage (tonne)"][year], digits = 6)
|
||||||
utilization_factor = round(processed / capacity * 100.0, digits = 2)
|
utilization_factor = round(processed / capacity * 100.0, digits = 6)
|
||||||
energy = round(location_dict["Energy (GJ)"][year], digits = 2)
|
energy = round(location_dict["Energy (GJ)"][year], digits = 6)
|
||||||
latitude = round(location_dict["Latitude (deg)"], digits = 6)
|
latitude = round(location_dict["Latitude (deg)"], digits = 6)
|
||||||
longitude = round(location_dict["Longitude (deg)"], digits = 6)
|
longitude = round(location_dict["Longitude (deg)"], digits = 6)
|
||||||
opening_cost = round(location_dict["Opening cost (\$)"][year], digits = 2)
|
opening_cost = round(location_dict["Opening cost (\$)"][year], digits = 6)
|
||||||
expansion_cost =
|
expansion_cost =
|
||||||
round(location_dict["Expansion cost (\$)"][year], digits = 2)
|
round(location_dict["Expansion cost (\$)"][year], digits = 6)
|
||||||
fixed_cost =
|
fixed_cost =
|
||||||
round(location_dict["Fixed operating cost (\$)"][year], digits = 2)
|
round(location_dict["Fixed operating cost (\$)"][year], digits = 6)
|
||||||
var_cost =
|
var_cost =
|
||||||
round(location_dict["Variable operating cost (\$)"][year], digits = 2)
|
round(location_dict["Variable operating cost (\$)"][year], digits = 6)
|
||||||
storage_cost = round(location_dict["Storage cost (\$)"][year], digits = 2)
|
storage_cost = round(location_dict["Storage cost (\$)"][year], digits = 6)
|
||||||
total_cost = round(
|
total_cost = round(
|
||||||
opening_cost + expansion_cost + fixed_cost + var_cost + storage_cost,
|
opening_cost + expansion_cost + fixed_cost + var_cost + storage_cost,
|
||||||
digits = 2,
|
digits = 6,
|
||||||
)
|
)
|
||||||
push!(
|
push!(
|
||||||
df,
|
df,
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ function products_report(solution; marginal_costs = true)::DataFrame
|
|||||||
longitude,
|
longitude,
|
||||||
year,
|
year,
|
||||||
amount,
|
amount,
|
||||||
marginal_cost,
|
|
||||||
amount_disposed,
|
amount_disposed,
|
||||||
|
marginal_cost,
|
||||||
acquisition_cost,
|
acquisition_cost,
|
||||||
disposal_cost,
|
disposal_cost,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -42,24 +42,24 @@ function transportation_report(solution)::DataFrame
|
|||||||
round(dst_location_dict["Longitude (deg)"], digits = 6),
|
round(dst_location_dict["Longitude (deg)"], digits = 6),
|
||||||
dst_location_dict["Input product"],
|
dst_location_dict["Input product"],
|
||||||
year,
|
year,
|
||||||
round(src_location_dict["Distance (km)"], digits = 2),
|
round(src_location_dict["Distance (km)"], digits = 6),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Amount (tonne)"][year],
|
src_location_dict["Amount (tonne)"][year],
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Amount (tonne)"][year] *
|
src_location_dict["Amount (tonne)"][year] *
|
||||||
src_location_dict["Distance (km)"],
|
src_location_dict["Distance (km)"],
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Transportation cost (\$)"][year],
|
src_location_dict["Transportation cost (\$)"][year],
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Transportation energy (J)"][year] /
|
src_location_dict["Transportation energy (J)"][year] /
|
||||||
1e9,
|
1e9,
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -44,18 +44,18 @@ function transportation_emissions_report(solution)::DataFrame
|
|||||||
round(dst_location_dict["Longitude (deg)"], digits = 6),
|
round(dst_location_dict["Longitude (deg)"], digits = 6),
|
||||||
dst_location_dict["Input product"],
|
dst_location_dict["Input product"],
|
||||||
year,
|
year,
|
||||||
round(src_location_dict["Distance (km)"], digits = 2),
|
round(src_location_dict["Distance (km)"], digits = 6),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Amount (tonne)"][year],
|
src_location_dict["Amount (tonne)"][year],
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
round(
|
round(
|
||||||
src_location_dict["Amount (tonne)"][year] *
|
src_location_dict["Amount (tonne)"][year] *
|
||||||
src_location_dict["Distance (km)"],
|
src_location_dict["Distance (km)"],
|
||||||
digits = 2,
|
digits = 6,
|
||||||
),
|
),
|
||||||
emission_name,
|
emission_name,
|
||||||
round(emission_amount[year], digits = 2),
|
round(emission_amount[year], digits = 6),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user