mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-05 23:38:52 -06:00
Reports: use dicts instead of lists
This commit is contained in:
@@ -31,14 +31,14 @@ function centers_report(model)::DataFrame
|
||||
end
|
||||
push!(
|
||||
df,
|
||||
[
|
||||
c.name,
|
||||
t,
|
||||
input_name,
|
||||
_round(input),
|
||||
_round(revenue),
|
||||
_round(c.operating_cost[t]),
|
||||
],
|
||||
Dict(
|
||||
"center" => c.name,
|
||||
"year" => t,
|
||||
"input product" => input_name,
|
||||
"input amount (tonne)" => _round(input),
|
||||
"revenue (\$)" => _round(revenue),
|
||||
"operating cost (\$)" => _round(c.operating_cost[t]),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
@@ -72,15 +72,15 @@ function center_outputs_report(model)::DataFrame
|
||||
end
|
||||
push!(
|
||||
df,
|
||||
[
|
||||
c.name,
|
||||
m.name,
|
||||
t,
|
||||
_round(collected),
|
||||
_round(disposed),
|
||||
_round(collection_cost),
|
||||
_round(disposal_cost),
|
||||
],
|
||||
Dict(
|
||||
"center" => c.name,
|
||||
"output product" => m.name,
|
||||
"year" => t,
|
||||
"amount collected (tonne)" => _round(collected),
|
||||
"amount disposed (tonne)" => _round(disposed),
|
||||
"collection cost (\$)" => _round(collection_cost),
|
||||
"disposal cost (\$)" => _round(disposal_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
|
||||
@@ -29,15 +29,15 @@ function plants_report(model)::DataFrame
|
||||
var_operating_cost = input * p.capacities[1].var_operating_cost[t]
|
||||
push!(
|
||||
df,
|
||||
[
|
||||
p.name,
|
||||
t,
|
||||
operational,
|
||||
_round(input),
|
||||
_round(opening_cost),
|
||||
_round(fix_operating_cost),
|
||||
_round(var_operating_cost),
|
||||
],
|
||||
Dict(
|
||||
"plant" => p.name,
|
||||
"year" => t,
|
||||
"operational?" => operational,
|
||||
"input amount (tonne)" => _round(input),
|
||||
"opening cost (\$)" => _round(opening_cost),
|
||||
"fixed operating cost (\$)" => _round(fix_operating_cost),
|
||||
"variable operating cost (\$)" => _round(var_operating_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
@@ -61,7 +61,14 @@ function plant_outputs_report(model)::DataFrame
|
||||
disposal_cost = p.disposal_cost[m][t] * disposed
|
||||
push!(
|
||||
df,
|
||||
[p.name, m.name, t, _round(produced), _round(disposed), _round(disposal_cost)],
|
||||
Dict(
|
||||
"plant" => p.name,
|
||||
"output product" => m.name,
|
||||
"year" => t,
|
||||
"amount produced (tonne)" => _round(produced),
|
||||
"amount disposed (tonne)" => _round(disposed),
|
||||
"disposal cost (\$)" => _round(disposal_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
|
||||
@@ -36,17 +36,17 @@ function transportation_report(model)::DataFrame
|
||||
end
|
||||
push!(
|
||||
df,
|
||||
[
|
||||
p1.name,
|
||||
p2.name,
|
||||
m.name,
|
||||
t,
|
||||
_round(amount),
|
||||
_round(distance),
|
||||
_round(tr_cost),
|
||||
_round(revenue),
|
||||
_round(collection_cost),
|
||||
],
|
||||
Dict(
|
||||
"source" => p1.name,
|
||||
"destination" => p2.name,
|
||||
"product" => m.name,
|
||||
"year" => t,
|
||||
"amount sent (tonne)" => _round(amount),
|
||||
"distance (km)" => _round(distance),
|
||||
"transportation cost (\$)" => _round(tr_cost),
|
||||
"center revenue (\$)" => _round(revenue),
|
||||
"center collection cost (\$)" => _round(collection_cost),
|
||||
),
|
||||
)
|
||||
end
|
||||
return df
|
||||
|
||||
Reference in New Issue
Block a user