# 𧬠Self-Parking Car Evolution
Training the car to do self-parking using a genetic algorithm.
> - ð [Launch the demo](https://trekhleb.dev/self-parking-car-evolution)
> - ð [Read about how it works](https://trekhleb.dev/blog/2021/self-parking-car-evolution/)
[![Self-Parking Car Evolution](./public/site-meta-image-02.jpg)](https://trekhleb.dev/self-parking-car-evolution)
This is an experimental project with the aim to learn the basics of how [genetic algorithm](https://en.wikipedia.org/wiki/Genetic_algorithm) works by teaching the cars to do the self-parking. The evolution process is happening directly in the browser. You may check the [evolution source-code](https://github.com/trekhleb/self-parking-car-evolution/tree/master/src/libs) (in TypeScript) or read the [explanation of how it works](https://trekhleb.dev/blog/2021/self-parking-car-evolution/) in my blog-post.
**At the beginning of the evolution** the generation of cars has random genomes which make them behave something like this:
![Self-parking cars at the beginning of the evolution](./public/01-cars-before-01.gif)
**On the 40th generation** the cars start learning what the self-parking is and start getting closer to the parking spot (although hitting the other cars along the way):
![Self-parking car in ](./public/02-car-after-01.gif)
Another example with a bit more challenging starting point:
![Self-parking car in ](./public/02-car-after-03.gif)
## Genetic Source-Code
The `â92%` of the code in this repository relates to the UI logic (3D simulation of the cars world, form controls for the evolution training process, etc.).
However, the actual [code that implements a genetic algorithm](https://github.com/trekhleb/self-parking-car-evolution/tree/master/src/libs) takes less than `<500` lines of code.
## Development Details
The project is a [React](https://create-react-app.dev/) application written on TypeScript. Styled with [BaseWeb](https://baseweb.design/).
The 3D world simulation is made with [Three.js](https://threejs.org/) library using [@react-three/fiber](https://github.com/pmndrs/react-three-fiber) wrapper. The physics is simulated with [Cannon.js](https://github.com/schteppe/cannon.js) using [cannon-es](https://github.com/pmndrs/cannon-es) wrapper.
The whole evolution simulation is happening directly in the browser.
To launch the project, fork/clone it and run the following commands:
```shell
npm install
npm run start
```
The website will be available on `http://localhost:3000/self-parking-car-evolution`.
**Hints:**
- You may upload one of the [pre-trained checkpoints](https://github.com/trekhleb/self-parking-car-evolution/tree/master/src/checkpoints) to avoid starting the evolution from scratch.
- Use the `?debug=true` URL param to see the FPS performance monitor and debugging logs in the console (i.e. `http://localhost:3000/self-parking-car-evolution?debug=true`).
- Training progress is being saved to the local storage for each generation (not for each batch/group).
没有合适的资源?快使用搜索试试~ 我知道了~
使用遗传算法训练汽车进行自动泊车_TypeScript_代码_下载
共139个文件
tsx:45个
ts:41个
gif:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 168 浏览量
2022-06-18
17:57:52
上传
评论
收藏 40.18MB ZIP 举报
温馨提示
使用遗传算法训练汽车进行自动泊车。 这是一个实验项目,旨在通过教汽车自动泊车来学习遗传算法如何工作的基础知识。进化过程直接发生在浏览器中。您可以查看进化源代码(在 TypeScript 中)关于它如何工作的说明。 效果展示: 在进化之初: https://github.com/trekhleb/self-parking-car-evolution/raw/master/public/01-cars-before-01.gif 第 40 代,汽车开始学习什么是自动泊车并开始靠近停车位(尽管沿途撞到其他汽车): https://github.com/trekhleb/self-parking-car-evolution/raw/master/public/02-car-after-01.gif
资源推荐
资源详情
资源评论
收起资源包目录
使用遗传算法训练汽车进行自动泊车_TypeScript_代码_下载 (139个子文件)
Timer.css 2KB
FadeIn.css 156B
Layout.css 42B
04-sensors-02.gif 3.63MB
03-car-after-02.gif 3.31MB
02-car-after-02.gif 3.31MB
02-cars-before-01.gif 2.84MB
01-cars-before-01.gif 2.84MB
03-car-after-01.gif 2.74MB
02-car-after-01.gif 2.74MB
02-cars-before-02.gif 2.5MB
01-cars-before-02.gif 2.5MB
03-car-after-03.gif 2.45MB
02-car-after-03.gif 2.45MB
02-cars-before-03.gif 2.1MB
01-cars-before-03.gif 2.1MB
03-car-muscles-01.gif 1.47MB
.gitignore 316B
beetle.glb 487KB
wheel.glb 42KB
index.html 2KB
favicon.ico 894B
site-meta-image-02.jpg 198KB
site-meta-image-01.jpg 137KB
04-sensors-01.jpg 112KB
01-cover-01.jpg 102KB
01-cover-00.jpg 88KB
package-lock.json 714KB
ckpt--population-1000--generation-45.json 355KB
ckpt--population-1000--generation-36.json 355KB
ckpt--population-1000--generation-25.json 355KB
package.json 2KB
tsconfig.json 535B
serve.json 422B
LICENSE 1KB
index.ru.md 63KB
index.md 45KB
README.md 3KB
README.md 306B
08-distance-to-parkin-lot.png 597KB
11-fin.png 562KB
05-sigmoid-03.png 320KB
06-genome-examples.png 153KB
09-fitness-function.png 151KB
05-sigmoid-02.png 126KB
06-floating-point-conversion-01.png 101KB
07-genetic-algorithm-flow-01.png 101KB
10-loss-history-00.png 91KB
03-car-muscles-03.png 66KB
05-sigmoid-01.png 12KB
05-sigmoid-01.svg 5KB
genetic.test.ts 9KB
evolution.ts 5KB
genetic.ts 5KB
carGenetic.ts 4KB
genomes.ts 4KB
floats.ts 3KB
floats.test.ts 2KB
constants.ts 2KB
url.ts 2KB
controllers.ts 2KB
car.ts 2KB
sigmoid.test.ts 2KB
carGenetic.test.ts 1KB
parking.ts 1KB
probability.ts 1KB
logger.ts 1KB
probability.test.ts 1KB
storage.ts 1KB
events.ts 1010B
materials.ts 965B
geometry.test.ts 933B
useKeyPress.ts 905B
polynomial.test.ts 793B
polynomial.ts 554B
vectors.ts 510B
performance.ts 457B
sigmoid.ts 438B
geometry.ts 390B
links.ts 353B
evolution.ts 335B
cars.ts 283B
models.ts 262B
setupTests.ts 241B
colors.ts 229B
models.ts 172B
routes.ts 163B
uuid.ts 157B
models.ts 115B
react-app-env.d.ts 104B
world.ts 93B
app.ts 60B
EvolutionTabEvolution.tsx 26KB
Car.tsx 11KB
EvolutionBoardParams.tsx 10KB
GenomePreview.tsx 8KB
EvolutionTabAutomatic.tsx 7KB
EvolutionCheckpointSaver.tsx 6KB
DynamicCars.tsx 5KB
EvolutionAnalytics.tsx 5KB
共 139 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9149
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Vue vs Angular:2024 年选择哪个框架
- 宽带账户密码生成器(获取上网帐号密码并自动保存到D盘)
- 防毒面具检测54-YOLO(v5至v9)、COCO、Darknet、VOC数据集合集.rar
- 算法(第4版).pdf
- 360占用解除器.rar
- 面试题记录1111111111111111111111111111111111111111111
- 大规模语言模型的查询语言:编程即提示
- 深度学习课设-基于resnet网络实现鼠标手写数字识别源码+数据集+模型+运行说明(带GUI界面,直接界面上手写).zip
- 蓝桥杯算法训练平台.zip
- 防护服检测40-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功