Git Product home page Git Product logo

pysimulate's Introduction

pysimulate

pip install pysimulate

Purpose

This project provides a framework to build a simulator to test different agents in a simple environment. This allows you to control the inputs/outputs of the system in python and hotswap the 'drivers' to the vehicles.

Use this repo to build your own AI drivers and test them on your own tracks!

Links

About

This project was built using the pygame and numpy libraries. In order to install these dependencies use:

pip install -r requirements.txt

Extend from the abstract class Simulation from simulation.py in order to create a custom simulation or simply use the DefaultSimulation class.

Same applies to building a custom vehicle from vehicle.py or using the DefaultVehicle class.

Author

Luke Harwood

[email protected]

[email protected]

www.lukeharwood.dev

Created on 05/24/2022

pysimulate's People

Contributors

lukeharwood11 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pysimulate's Issues

Collision Detection with vehicle and track mask

Unimplemented feature: the simulation should keep track of whether or not the car has collided with the track. This should be checked by the car and the simulation should hold the information.

note: the vehicle class should keep track of how many times the entity has collided and the simulation should reset when this event has occurred.

Implement notification labels that fade out

Create a timed one time message that can pop up on the simulation to notify the observer (of the simulation) that an event has occurred (such as a reward collision).

Build a class that can manage the timed fade along with a simplistic post method to the simulation.

Create headless mode for genetic algorithm simulator

  • Implement a heuristic for determining how well the model is doing
  • Implement a method for determining whether or not the model is done
  • Implement a test suite to manage simulations
  • Implement a genetic simulation that can operate headless and then display progress

Rendering Optimizations

As objects are changed throughout the main loop, only the objects that are changed should be rendered using the update() method as opposed to the flip() method.

Implement number of iterations

Add a label to the top of the simulation that displays the number of iterations that the simulation has been through.

Implement offset for sensor intersection circles

When displaying circles that represent an intersection with the track, the circles are placed (technically) in the wrong location.
Instead of being displayed by their upper left "placement point", they should be displayed by their center accounting for their radius.

Image rotation optimization

The loading of the vehicle images should be optimized and user friendly. Currently the user of the framework is responsible for calling convert() on the images, this should be fixed.

  • all 359 rotations should be loaded and cached when the simulation is started
  • use cached images when turning vehicle

convert() cannot be called before pygame.init()

With the current state of the project convert() cannot be called until Simulation has been initialized. This is because convert() cannot be called until pygame.init() has been called.

  • create a more user friendly solution to this problem

tensorflow dependency issue

got below error while trying to run example.py
from keras.optimizer_v2.adam import Adam
ModuleNotFoundError: No module named 'keras.optimizer_v2'

installed keras version
Name: keras
Version: 2.10.0
Summary: Deep learning for humans.
Home-page: https://keras.io/
Author: Keras team
Author-email: [email protected]
License: Apache 2.0
Location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
Requires:
Required-by: tensorflow

Reward detection within Simulation

The vehicle class should check to see if it has collided with a reward.

  • the car should keep track of whether this is a first time collision or not
  • the simulation should know about the collision

Create debugger logging option that allows for differing levels of logging to the console.

Allow for the following logging levels/types:

  1. Debug:
  • Any information
  1. Trace:
  • Important processing information
  1. Error:
  • System encounters a non-crashing problem that should be fixed
  1. Fatal:
  • System encounters a crashing problem that must be resolved

Lower levels log anything (including itself) higher that itself. (e.g. if debug mode is set, all 4 levels are displayed, whereas if Error is set then only Errors and Fatal messages will appear in the logs).

Sensor Collision with track mask

Implement sensor feature

  • If no collision occurs, a default value should be set as the value of the sensor
  • If a collision does occur, the two coordinate pairs (for the sensor display) should be the car position (with offset) and the collision point

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.