-
- A 2D traffic map, & you can move an UnitObj in the Map from one Place to another (-- the Pathing Algorithm finds the way out).
- (Pretty much like how you control the units in an RTS game.)
-
-
TrafficSystem.20230609_003641.demo01_CrossBlock_Complex.mp4
<video controls> <source src="images/TrafficSystem 20230609_003641 demo01_CrossBlock_Complex.mp4" type="video/mp4"> </video> </li> <li>
TrafficSystem.20230609_004856.demo02_AlignedCube_ComplexMoving_TrafficLight.mp4
<video controls> <source src="images/TrafficSystem 20230609_004856 demo02_AlignedCube_ComplexMoving_TrafficLight.mp4" type="video/mp4"> </video> </li> <li>(Github md video support is very limited & its breaking the html code -- a li is added below to fix that)</li>
-
- This is only an Experimental project
- This is only an Experimental project
-
- Left click to select an UnitObj (for movable & selectable -- controllable ones)
- Right click to move the UnitObj to that location
-
- vv
-
Functionality Hotkey Description Activated When * select an UnitObj
(for controllable ones)LButton move an UnitObj
to Target LocationRButton move an UnitObj
to Multi Scheduled Target Locations+RButton pause Movement
of Selected UnitObjs resume Movement
of Selected UnitObje cancel Movement
of Selected UnitObjc select all UnitObj
(for controllable ones)^a unselect all UnitObj MButton select multiple UnitObj ^LButton select on the Main UnitObj !s drag an UnitObj
(for draggable ones)^!LButton (drag) clear Debug Shapes !a - * annotate
- Ahk Hotkey style Notation
- ^ = Ctrl
- ! = Alt
- + = Shift
- LButton = Left Mouse Click
- Ahk Hotkey style Notation
-
- vv
- You can send a
POST
request to theTrafficController
Service in Port 18091, eg: http://localhost:18091/v0.2.1.0/user/createTrafficLight_demo_AlignedCube?sn_row_Target=2&sn_col_Target=1&timeLength_AllowMove=100&timeLength_StopMove=100&mode_VerticalOrHorizontal=false
- (This in turn sends (delegates) a request (internally) to the
TrafficPathing
) - & creates a
TrafficLight
at the specified location (for the demo)
- You can send a
- vv
-
-
PathingUtil
is the central of the Pathing Algorithmcom.redfrog.traffic.pathing.PathingUtil.goTo_TargetLocation(UnitObj, double, double, double, GotoMode)
is the main Api to use for Moving a (controllable) UnitObj to a Target Location
TrafficItemControlService
is the central for creating the UnitObj (& the Map) (& Demo)
-
-
algorithm (function name) success rate time complexity description logic complexity (*some trivals) 5% (low)
only works for simple shapesO(1)
1% get_Points_AtCloserDirection_ByAreaDet
10%
only works for simple shapesO(1)
10% repath_by_WrapVertexSearchAlg
_by_PermutationAndIntersection100%
works in all cases
always finds the path (unless unreachable pratically)
always finds the shortest path~O(n!)
- uses a Permutation to brute force all the possible paths
- (not just random brute force -- some level of logic is still required)
- takes very Long time to calculate -- when the shape is complex
- (optimization are added, made faster, but still not fast enough)
45% repath_by_WrapVertexSearchAlg
_by_DirectionalTangentLine_with_ShortestGotoPoint70%
works in many cases
sometimes fails to find a path (even such path exist pratically)
often not finding the shortest path~O(n)
50% repath_by_WrapVertexSearchAlg
_by_DirectionalTangentLine_with_Permutation95%~100%
works in most/all cases
always finds the path (should)
may not find the shortest path~O(n)
~O(n^2)
~O(n!)- (permutation is involved, a bit)
- (lots other nested sub algorithms / mechanisms are added for optimization)
65% - uses a Permutation to brute force all the possible paths
- * the rate / complexity values are just rough estimations, no real math / benchmark
-
-
-
- JavaFx
- Spring
-
- Number Precision
- double precision problem is a messy problem
- in a Graphical app, precise Math calculations are required
- eg: for the logic of Pathing Algorithm
- eg: when you need to check for Collision
- (tbh, this can apply to any other situations too...)
- Collide & Stuck & Calc Hang & Both Dynamic
- this happened many times (likey a bug)
- I cannot tell where this is coming from:
- inf loop/recursion;
- some random bug (due to collision / determination of sth);
- or there is no bug, but just the calculation is taking too long;
- when there is only one UnitObj moving, the collision & pathing looks fine -- does not seem such bug
- when there are 2 UnitObj moving -- especially when one of the UnitObj is doing unstoppable moving, the bug appears way more often
- (-- if none are doing unstoppable moving -- seems fine)
- Speed & Frame (& Incremental movements)
AnimationTimer
is executing base on Frame, not Time.- This makes the calculation of Speed & detection of Collision harder.
- Number Precision
-
- Where is the Comment & JavaDoc?
- The comments I had in the Code are hideously long & unreadable. So they are all removed.
- (Hopefully this doesnt break the code, it shouldnt but might remove some actual code accidentally during the process.)
- The comments I had in the Code are hideously long & unreadable. So they are all removed.
- Where is the Comment & JavaDoc?
-
Notifications
You must be signed in to change notification settings - Fork 0
Norlandz/TrafficSystem
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Specify a target location, the selected units in the map will move there by finding a path.