config module

Configuration classes for all of the components

class config.GUIConfig[source]

Bases: object

Configuration used by the gui module

tuple attributes store main text at index 0, and tooltip text at index 1

CompareText = 'Compete with AUDRI'

(str) Text for the button in the MainFrame, linking to the Simulator in compare mode

ConfAppearance = 'Appearance'

(str) Header text for the appearance parameters section in the ConfigFrame

ConfBackground = ('Scroll background', 'Whether the background should scroll down the window, as if the car\nis travelling down it\nDisable if you experience dizziness')
ConfCarScale = ('Car scale', 'Multiplied against the normal size of the car sprite')
ConfCarSpeed = ('Car speed', '(metres per second)\nThe forward speed of the main car')
ConfExperiment = 'Experiment parameters'

(str) Header text for the experimental parameters section in the ConfigFrame

ConfFPS = ('Frames per second', 'Frame rate - how many times per second the screen is redrawn\nHigher values will likely result in more CPU usage')
ConfInnerPadding = 15

(int) Padding between labels and their connected control in the ConfigFrame

ConfObstFreq = ('Obstacle frequency', '(seconds)\nTime between obstacles spawning')
ConfObstScale = ('Obstacle scale', 'Multiplied against the normal size of the obstacle sprites')
ConfObstSpeed = ('Obstacle speed', '(metres per second)\nThe forward speed of the obstacle vehicles\nMust be smaller than car speed')
ConfOffroad = ('Allow the car to drive offroad', 'If checked, the main car will be able to use the offroad areas to avoid vehicles')
ConfRandomSeed = ('Random seed', 'The value used to control pseudo-random number generation')
ConfRecordFreq = ('Snapshot interval', 'Gap in seconds between recordings of the state of the simulation')
ConfRowPadding = 10
ConfSave = ('Save', 'Save configuration and return to the main menu')
ConfText = 'Configuration'

(str) Text for the button in the MainFrame, linking to the ConfigFrame

ConfTickrate = ('Tickrate', 'Tick rate - how many times per second the game logic should run\nLower values will impact expermiental accuracy\nHigher values will likely result in more CPU usage')
ConfTitle = 'Configuration'

(str) Header text in the ConfigFrame

DataText = 'Gather training data'

(str) Text for the button in the MainFrame, linking to the Simulator in training mode

Font = {'family': 'sans-serif', 'size': 10}

(dict) Data used to create a normal font

FontBold = {'family': 'sans-serif', 'size': 10, 'weight': 'bold'}

(dict) Data used to create a bold font

FontHeading = {'family': 'sans-serif', 'size': 15, 'weight': 'bold'}

(dict) Data used to create a header font

FontMonospace = {'family': 'monospace', 'size': 10}

(dict) Data used to create a monospaced font

Height = 600

(int) Height of the main window

MainButtonXPad = 15
MainButtonYPad = 15
ModeText = ['manual', 'AUDRI', 'compare']

list of str mapping simulator modes to a description of that mode, used by SimulatorPanel

PanelWidth = 220

(int) Width of the Panel

SimPopupDupWarn = 'This name is already in use, overwrite?'

Duplicate warning message in (NameDatasetPopup)

SimPopupPad = 10

Padding in (NameDatasetPopup)

SimPopupText = 'Choose a name for this training set'

Message in (NameDatasetPopup)

SimPopupTitle = 'Name the training set'

Window title of the popup for naming a training set (NameDatasetPopup)

Subtitle = 'Teaching a computer to drive through example'

(str) Subtitle shown in the MainFrame

TestText = 'Test AUDRI'
Theme = 'clam'

(str) Tkinter theme to use

Title = 'AUDRI Simulator'

(str) Main title shown in the titlebar and the MainFrame

TooltipWidth = 250
VisualiserWidth = 500

(int) Width of the visualiser.visualiser.SimulatorVisualiser

class config.SimulatorConfig[source]

Bases: object

Configuration used by the visualiser class

CarScale = 0.35

(float) Scale of the car’s sprite

CarSpeed = 11

(float) Speed of the main car in metres per second

FPS = 70

(int) Targeted frames per second to be drawn

LaneWidth = 86

(int) Width of a lane

ObstacleInterval = 2

(float) Seconds between spawning obstacles

ObstacleSpeed = 8
(float) Speed of obstacle vehicles in metres per second
Should be less than CarSpeed
OffroadAllowed = False

(bool) Whether the car can go offroad

OffroadWidth = 120

(int) Width of a an offroad lane

PixelMetreRatio = 50

(float) Ratio of pixels to metres, affects the visualisation of speeds

RandomSeed = 'geqJQD6MfJ'

Random seed used to influence when vehicles spawn Can be int, str, and others. See random.seed() for details

RecordInterval = 0.2

(float) Seconds between each snapshot

ScrollBackground = True

(bool) Whether the background should move

TickRate = 5

(int) Targeted milliseconds between each simulation tick

class config.Singleton[source]

Bases: type

Metaclass that provides singleton behaviour

Author:Adam Forsyth <adam@adamforsyth.net>
Source:https://stackoverflow.com/a/6798042
_instances = {}

(dict) stores the instances of each class