Skip to content

subsonicpulse/prolog-intersection-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

prolog-intersection-simulation

This program simulates a intersection in Prolog.

image
#####al v .    #####
.    .    .    .    
cy v .    .    .    
#####.    .    #####

al: north, straight
cy: west, right

al: blocked(straight,right_present)
cy: ok(right)

?- list_right_of_way.
al: blocked(straight,right_present)
cy: ok(right)

true.

Prerequisites

Start Program

Command Line

  • type cmd in Windows search box
  • type cd <folder with downloaded code>\prolog-intersection-simulation
  • type "C:\Program Files\swipl\bin\swipl-win.exe" --win_app -q -s "%CD%\main.prolog"

Visual Studio Code

  • open <folder with downloaded code>\prolog-intersection-simulation in Visual Studio Code
  • select main.prolog
  • press CTRL + SHIFT + B to run task:
    • starting current file with C:\Program Files\swipl\bin\swipl-win.exe

Note:
Path to SWI-Prolog can be changed in .vscode\tasks.json,
see "command": "C:\\Program Files\\swipl\\bin\\swipl-win.exe"

Program Commands

Call help. for listing available commands.

Simulation

Call simulate. for automated control of the cars. Call step. for stepwise clearing.

Car Management

Adding or removing cars manually e.g. add_random_car. or clear_cars., need call to draw_grid_xpce or draw_grid to see changes.

About

Prolog Intersection Simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages