mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
output trade to csv file
This commit is contained in:
parent
dc4b9dc19e
commit
53ace17327
@ -112,6 +112,14 @@ pub fn csv_entry(f: &mut std::fs::File, site: &Site) -> Result<(), std::io::Erro
|
||||
write!(f, "{:?},", limit)?;
|
||||
}
|
||||
}
|
||||
f.write_all(b",")?;
|
||||
for g in good_list() {
|
||||
if site.economy.last_exports[g]>=0.1 || site.economy.last_exports[g]<=-0.1 {
|
||||
write!(f, "{:.1},", site.economy.last_exports[g])?;
|
||||
} else {
|
||||
f.write_all(b",")?;
|
||||
}
|
||||
}
|
||||
writeln!(f)
|
||||
}
|
||||
|
||||
@ -153,6 +161,10 @@ fn simulate_return(index: &mut Index, world: &mut WorldSim) -> Result<(), std::i
|
||||
for l in LaborIndex::list() {
|
||||
write!(f, "{:?} limit,", l)?;
|
||||
}
|
||||
f.write_all(b",")?;
|
||||
for g in good_list() {
|
||||
write!(f, "{:?} trade,", g)?;
|
||||
}
|
||||
writeln!(f)?;
|
||||
Some(f)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user