Erlang concurrency example for educational purposes.
- planes moving around X,Y surface
- X, Y are non-negative values, together they form plane coordinates that is {X, Y} = {Plane distance from airport, Lane number}
- {X, Y} = {0, 0} - point representing the airport, if reached by a plane landing is considered succesful
- plane crashes may occur in the air (collision between planes) or while landing (when Distance is 0 but Lane is not 0)
- Planes parameters are:
- Speed (higher value - slower plane),
- Distance - how far from there airport
- Lane - 0 is the Lane enabling a proper landing
- succesfull landing happens if plane reaches {0, 0} position
2 1 0 (Distance from airport)
2 P-----
1 ------
0 ------AIRPORT
(Lane
number)
- get Erlang installed (erl command present in PATH)
- start Erlang shell with "erl" command
- compile and load Erlang module with "c(flightcontrol), l(flightcontrol)."
- start selected simulation function for example with "flightcontrol:simulate()."