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:
@ -112,6 +112,14 @@ pub fn csv_entry(f: &mut std::fs::File, site: &Site) -> Result<(), std::io::Erro
|
|||||||
write!(f, "{:?},", limit)?;
|
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)
|
writeln!(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +161,10 @@ fn simulate_return(index: &mut Index, world: &mut WorldSim) -> Result<(), std::i
|
|||||||
for l in LaborIndex::list() {
|
for l in LaborIndex::list() {
|
||||||
write!(f, "{:?} limit,", l)?;
|
write!(f, "{:?} limit,", l)?;
|
||||||
}
|
}
|
||||||
|
f.write_all(b",")?;
|
||||||
|
for g in good_list() {
|
||||||
|
write!(f, "{:?} trade,", g)?;
|
||||||
|
}
|
||||||
writeln!(f)?;
|
writeln!(f)?;
|
||||||
Some(f)
|
Some(f)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user