src.Record package

Submodules

src.Record.frame module

class src.Record.frame.Frame[source]

Bases: object

delete_by_id(id: int)[source]
Parameters

id – the id of the vehicle that you want to delete

Returns

no return

deleteat(entity_index: int)[source]
Parameters

entity_index – the index of the vehicle that we want to delete

Returns

no return

empty()[source]
Returns

no return, empty the whole list

findfirst(id: int)[source]
Parameters

id – the vehicle id

Returns

the first vehicle’s index who has the corresponding id

init(n: int)[source]
Parameters

n – the number of vehicle

Returns

no return

push(entity)[source]
Parameters

entity – the entity to push back

Returns

no return

src.Record.frame.copyto(dest: src.Record.frame.Frame, src: src.Record.frame.Frame)[source]
Parameters
  • dest – the frame we are copying to

  • src – the frame we are copying from

Returns

destination frame

src.Record.record module

class src.Record.record.ListRecord(timestep: float, frames: list, states: list, defs: dict)[source]

Bases: object

n_objects_in_frame(frame_index: int)[source]
Parameters

frame_index – the index of the frame

Returns

the length of the frame given the index

property nframes
Returns

the number of all the frames

property nids
Returns

the number of all the vehicles

property nstates
Returns

the number of all the states

write(fp)[source]
Parameters

fp – the frame pointer to write

Returns

write file, no return

class src.Record.record.RecordFrame(lo: int, hi: int)[source]

Bases: object

write(fp)[source]
Parameters

fp – the file pointer to write

Returns

write to file, no return

class src.Record.record.RecordState(state: src.Basic.Vehicle.VehicleState, id: int)[source]

Bases: object

used to record the information of a state

class src.Record.record.SceneRecord[source]

Bases: object

property capacity
Returns

capacity of the SceneRecord object

empty()[source]
Returns

empty the SceneRecord Stack

init(capacity: int, timestep: float, frame_capacity: int = 100)[source]

Initializing the SceneRecord object :param capacity: the capacity of the object :param timestep: timestep indicator :param frame_capacity: the capacity of a single frame :return:

insert(frame: src.Record.frame.Frame, pastframe: int = 0)[source]
Parameters
  • frame – the frame to be inserted

  • pastframe – <=0, -n represent past n frame

Returns

no return

push_back_records()[source]

push back frames from tail to head :return: no return

update(frame: src.Record.frame.Frame)[source]

update the first frame :param frame: the frame to be updated :return: no return

src.Record.record.frame_inbounds(rec: src.Record.record.ListRecord, frame_index: int)[source]

check if the index is in bound :param rec: ListRecord :param frame_index: index of the frame to be checked :return: false if out of bound true otherwise

src.Record.record.get_def(rec: src.Record.record.ListRecord, id: int)[source]

get the vehicle definition given a query id :param rec: ListRecord object :param id: query id :return: the vehicle definition for the query id

src.Record.record.get_elapsed_time_3(rec: src.Record.record.SceneRecord, pastframe_farthest_back: int, pastframe_most_recent: int)[source]
src.Record.record.get_scene(frame: src.Record.frame.Frame, rec: src.Record.record.ListRecord, frame_index: int)[source]

get the scene given a query frame index :param frame: the buffer for the frame :param rec: the ListRecord object :param frame_index: the frame index :return: the frame for the query index

src.Record.record.get_vehicle(rec: src.Record.record.ListRecord, stateindex: int)[source]

get vehicle state given a state index :param rec: ListRecord object :param stateindex: query state index :return: the vehicle state for the query state index

src.Record.record.pastframe_inbounds(rec: src.Record.record.SceneRecord, pastframe: int)[source]

check if the query pastframe is out of bound :param rec: SceneRecord :param pastframe: the query pastframe number :return: false if out of bound true otherwise

src.Record.record.read_frame(fp)[source]
Parameters

fp – the frame pointer to read

Returns

a RecordFrame object

src.Record.record.read_trajdata(fp)[source]
Parameters

fp – the frame pointer to read

Returns

a ListRecord object

Module contents