suboptimumg.compsim.competition#

Full FSAE competition with scoring logic.

class suboptimumg.compsim.competition.Competition(mycar, accel, skidpad, autoX, endurance, scoring, **kwargs)[source]#

Bases: object

Parameters:
accel_event(extract_internal_data=False)[source]#

Simulates the acceleration event in the competition.

Parameters:

extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

Returns:

The results of the acceleration event simulation.

Return type:

EventResults

autoX_event(extract_internal_data=False)[source]#

Simulates the autocross event in the competition.

Parameters:

extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

Returns:

The results of the autocross event simulation.

Return type:

EventResults

efficiency_endurance_event(extract_internal_data=False)[source]#

Simulates the endurance event in the competition, and also calculates efficiency points.

Parameters:

extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

Returns:

The results of the endurance event simulation and efficiency points.

Return type:

Tuple[EventResults, float]

endurance_event(extract_internal_data=False, use_coast=True)[source]#

Simulates the endurance event in the competition.

Parameters:
  • extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

  • use_coast (bool)

Returns:

The results of the endurance event simulation.

Return type:

EventResults

run(extract_internal_data=False)[source]#

Runs all competition events and returns their results.

Parameters:

extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

Returns:

Results from all competition events including efficiency points.

Return type:

CompetitionResults

skidpad_event(extract_internal_data=False)[source]#

Simulates the skidpad event in the competition.

Parameters:

extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

Returns:

The results of the skidpad event simulation.

Return type:

EventResults

to_data()[source]#

Serialize the Competition to a CompetitionData model for Pydantic serialization.

Return type:

CompetitionData