jupedsim.sqlite_serialization#

Module Contents#

DATABASE_VERSION: Final = 2[source]#
get_database_version(connection: sqlite3.Connection) int[source]#
Parameters:

connection (sqlite3.Connection) –

Return type:

int

uses_latest_database_version(connection: sqlite3.Connection) bool[source]#
Parameters:

connection (sqlite3.Connection) –

Return type:

bool

class SqliteTrajectoryWriter(*, output_file: pathlib.Path, every_nth_frame: int = 4)[source]#

Bases: jupedsim.serialization.TrajectoryWriter

Write trajectory data into a sqlite db

SqliteTrajectoryWriter constructor

Parameters:
  • output_file (pathlib.Path) – pathlib.Path name of the output file. Note: the file will not be written until the first call to begin_writing()

  • every_nth_frame (int) – int indicates interval between writes, 1 means every frame, 5 every 5th

Returns:

SqliteTrajectoryWriter

begin_writing(simulation: jupedsim.simulation.Simulation) None[source]#

Begin writing trajectory data.

This method is intended to handle all data writing that has to be done once before the trajectory data can be written. E.g. Meta information such as framerate etc…

Parameters:

simulation (jupedsim.simulation.Simulation) –

Return type:

None

write_iteration_state(simulation: jupedsim.simulation.Simulation) None[source]#

Write trajectory data of one simulation iteration.

This method is intended to handle serialization of the trajectory data of a single iteration.

Parameters:

simulation (jupedsim.simulation.Simulation) –

Return type:

None

every_nth_frame() int[source]#

Returns the interval of this writer in frames between writes.

1 indicates all frames are written, 10 indicates every 10th frame is writen and so on.

Returns:

Number of frames between writes as int

Return type:

int

connection() sqlite3.Connection[source]#
Return type:

sqlite3.Connection

update_database_to_latest_version(connection: sqlite3.Connection)[source]#
Parameters:

connection (sqlite3.Connection) –

convert_database_v1_to_v2(connection: sqlite3.Connection)[source]#
Parameters:

connection (sqlite3.Connection) –