larvaworld.lib.screen.side_panel

Screen side-panel for pygame-based simulation visualization

Classes

SidePanel

A class representing a side panel for displaying information in a Pygame viewer.

Module Contents

class larvaworld.lib.screen.side_panel.SidePanel(viewer)

A class representing a side panel for displaying information in a Pygame viewer.

FONT_SIZE = 30
LINE_SPACING_MIN = 25
LINE_SPACING_MAX = 35
SCENE_HEIGHT_THRESHOLD = 700
DEFAULT_MARGIN = 35
LEFT_MARGIN = 30
viewer
line_num = None
line_spacing = 35
display_ga_info()

Displays information about the Genetic Algorithm (GA) on the side panel.

render_line(text, extra_margin=0)

Renders a text line on the side panel.

Parameters:
  • text – The text to render.

  • extra_margin – Additional margin for the text.

draw(v, **kwargs)

Draws the side panel on the Pygame viewer.

Parameters:
  • v – The Pygame viewer.

  • kwargs – Additional drawing arguments.