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