Fix garden output to CSV
This commit is contained in:
parent
2b4c21972d
commit
2982cbf42c
1 changed files with 4 additions and 3 deletions
|
@ -3,6 +3,7 @@ module GardenOptim
|
||||||
using Logging
|
using Logging
|
||||||
|
|
||||||
using DocStringExtensions
|
using DocStringExtensions
|
||||||
|
using Tables
|
||||||
|
|
||||||
export loadplants, loadgarden, loadclassification, loadcosts
|
export loadplants, loadgarden, loadclassification, loadcosts
|
||||||
export update!, randomgardenevolution!, outputgarden
|
export update!, randomgardenevolution!, outputgarden
|
||||||
|
@ -18,9 +19,9 @@ include("loaddata.jl")
|
||||||
include("mcmc.jl")
|
include("mcmc.jl")
|
||||||
|
|
||||||
"Save the garden to a CSV file."
|
"Save the garden to a CSV file."
|
||||||
function outputgarden(garden::Matrix{Int}, plants::Vector{String})
|
function outputgarden(garden::Matrix{Int}, plants::Vector{Symbol})
|
||||||
output = vcat([""], plants)[garden .+ 1]
|
output = vcat([""], String.(plants))[garden .+ 1]
|
||||||
CSV.write("output.csv", Tables.table(output), writeheader=false)
|
CSV.write("out/output.csv", Tables.table(output), writeheader=false)
|
||||||
end
|
end
|
||||||
|
|
||||||
end # module
|
end # module
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue