Skip to content

Clean up solution score handling in autopilot #4007

@MartinquaXD

Description

@MartinquaXD

Background

How the autopilot currently handles scores of solutions is quite awkward. It takes a /solve response from a driver and turns it into a domain type. This struct has an optional score field which is set to None at construction. Later when the autopilot runs the winner selection logic it sets the value to Some(score). From that point onward the field is fully initialized and later read by the autopilot to ultimately store it in the DB.
This 2 phase initialization process is error prone since someone could try to read the value before it's initialized.

Ideally the code would be updates to make this value non-optional by already scoring the solution at construction of the domain type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions