57 Scheme(
const std::string &simulation_id) :
61 "step integer NOT NULL," +
62 "num_cells integer NOT NULL," +
63 "hours DOUBLE PRECISION NOT NULL" +
70 "step integer NOT NULL," +
71 "cell_id integer NOT NULL," +
72 "type integer NOT NULL," +
73 "state integer NOT NULL," +
74 "x DOUBLE PRECISION NOT NULL," +
75 "y DOUBLE PRECISION NOT NULL," +
76 "z DOUBLE PRECISION NOT NULL," +
77 "radius DOUBLE PRECISION NOT NULL);"),
83 "step, cell_id, type, state, x, y, z, radius)"),
92 template<
typename cell_t,
typename world_t>
103 auto pos = c->getBody().getPosition();
110 template<
typename world_t>
118 template<
typename cell_t,
typename world_t>
120 auto pos = c->getBody().getPosition();
126 ss << w->getNbUpdates() <<
", ";
127 ss << c->getId() <<
", ";
128 ss << static_cast<unsigned int>(c->getType()) <<
",";
129 ss << static_cast<unsigned int>(c->getState()) <<
",";
130 ss <<
"CAST(" <<
pos.
x() <<
" AS DOUBLE PRECISION), ";
131 ss <<
"CAST(" <<
pos.
y() <<
" AS DOUBLE PRECISION), ";
132 ss <<
"CAST(" <<
pos.
z() <<
" AS DOUBLE PRECISION), ";
133 ss <<
"CAST(" << c->getBody().getBoundingBoxRadius() <<
" AS DOUBLE PRECISION)";
136 template<
typename world_t>
138 std::stringstream ss;
140 ss << w->getNbUpdates() <<
", ";
141 ss << w->cells.size() <<
", ";
142 ss << w->getNbUpdates() * w->dt / 3600;
void appendDouble(double d)
void beginRow(int16_t nCols)
Provides common mathematical functions and vector operations.
const std::string WorldTable
const std::string WorldTableDataLayout
static void CellValueStatement(std::stringstream &ss, cell_t *c, world_t *w)
const std::string CellTable
const std::string CellTableDataLayout
std::string WorldTableCreationStatement
std::string CellTableCreationStatement
static std::string WorldValueStatement(world_t *w)
Scheme(const std::string &simulation_id)
static void CellValueBinary(Connection &conn, cell_t *c, world_t *w)
static constexpr size_t WorldRowSize
static void WorldValueBinary(Connection &conn, world_t *w)