Skip to content

Commit

Permalink
Merge pull request #21 from davidedomini/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
davidedomini authored Sep 11, 2022
2 parents d2203a6 + 2336032 commit 8a48d43
Show file tree
Hide file tree
Showing 63 changed files with 1,864 additions and 1,136 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# sim-race

Project for `Paradigmi di Programmazione e Sviluppo` course of `University of Bologna` (A.Y. 2021/2022).

```pps-sim-race``` is a F1 race simulator. Once the application is started, it will be possible to set some parameters like: car max speed, car tyres, race laps and so on. The user will be able to view the evolution of the race with a 2D top view of the track, some charts and a real-time standings. At the end of the simulation a resume will be available and the user may starts new simulations.

## Requirements
The following dependencies are required to run the application:
- sbt version 1.6.1
- scala version 3.1.2
- JDK version 11

## Usage
You can find the latest `jar` for your OS inside the [Releases section](https://github.com/davidedomini/pps-22-sim-race/releases).

To execute the application:
```powershell
$ java -jar `<jar-path>`
```

Otherwise, you can clone the repository and execute the application with the following commands:

```powershell
$ sbt compile
$ sbt run
```

## Documentation and development process

You can find the project's report (report.md) in the `doc` folder into the `doc` branch or at this [link](https://github.com/davidedomini/pps-22-sim-race/tree/doc).

Futhermore, you can find the web version [here](https://davidedomini.github.io/pps-22-sim-race/)

## Authors
- [Davide Domini](https://github.com/davidedomini)
- [Alessandro Magnani](https://github.com/alessandromagnani17)
- [Andrea Matteucci](https://github.com/AndreaMatteucci)
- [Simone Montanari](https://github.com/Zimon99)
17 changes: 8 additions & 9 deletions src/main/resources/prolog/basetrack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
% E ---> External
% I ---> Internal

%straight(id, x0_E, y0_E, x1_E, y1_E, x0_I, y0_I, x1_I, y1_I)
%straight(id(ID), startPointE(X0_E, Y0_E), endPointE(X1_E, Y1_E), startPointI(X0_I, Y0_I), endPointI(X1_I, Y1_I))
straight(id(1), startPointE(181, 113), endPointE(725, 113), startPointI(181, 170), endPointI(725, 170), end(725), direction(1)).
straight(id(3), startPointE(181, 453), endPointE(725, 453), startPointI(181, 396), endPointI(725, 396), end(181), direction(-1)).

%Direction ---> -1 or 1
%Direction ---> -1 forward or 1 backward
%SP ---> Start Point
%EP ---> End Point

%turn(id, x_center, y_center, x_SP_E, y_SP_E, x_SP_I, y_SP_I, x_EP_E, y_EP_E, x_EP_I, y_EP_I,direction)
%Query: turn(id(ID), center(X, Y), startPointE(X0_E, Y0_E), startPointI(X0_I, YO_I), endPointE(X1_E, Y1_E), endPointI(X1_I, Y1_I), direction(D))
turn(id(2), center(725, 283), startPointE(725, 113), startPointI(725, 170), endPointE(725, 453), endPointI(725, 396), direction(1)).
turn(id(4), center(181, 283), startPointE(181, 113), startPointI(181, 170), endPointE(181, 453), endPointI(181, 396), direction(-1)).
turn(id(2), center(725, 283), startPointE(725, 113), startPointI(725, 170), endPointE(725, 453), endPointI(725, 396), direction(1), topLimit(175), bottomLimit(390)).
turn(id(4), center(181, 283), startPointE(181, 113), startPointI(181, 170), endPointE(181, 453), endPointI(181, 396), direction(-1), topLimit(175), bottomLimit(390)).


%startingPoint(id, x_position, y_position)
%Query: startingPoint(id(ID), position(X, Y)).
startingPoint(id(1), position(313, 115)).
startingPoint(id(2), position(293, 129)).
startingPoint(id(3), position(273, 142)).
startingPoint(id(4), position(253, 155)).

finalPosition(position(633, 272)).
finalPosition(position(533, 272)).
finalPosition(position(433, 272)).
finalPosition(position(333, 272)).
8 changes: 4 additions & 4 deletions src/main/resources/prolog/cars.pl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
car(path("/cars/0-soft.png"), name("Ferrari"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(2),
car(path("/cars/0-soft.png"), name("Ferrari"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(3),
actualSector(1), fuel(130), color("Ferrari")).

car(path("/cars/1-soft.png"), name("Mercedes"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(2),
car(path("/cars/1-soft.png"), name("Mercedes"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(3),
actualSector(1), fuel(130), color("Mercedes")).

car(path("/cars/2-soft.png"), name("Red Bull"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(2),
car(path("/cars/2-soft.png"), name("Red Bull"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(3),
actualSector(1), fuel(130), color("Red Bull")).

car(path("/cars/3-soft.png"), name("McLaren"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(2),
car(path("/cars/3-soft.png"), name("McLaren"), tyre("Soft"), driver(1), maxSpeed(200), acceleration(3),
actualSector(1), fuel(130), color("McLaren")).

%Query --> Get all cars params
Expand Down
14 changes: 0 additions & 14 deletions src/main/resources/prolog/movements.pl

This file was deleted.

Loading

0 comments on commit 8a48d43

Please sign in to comment.