Skip to content

Commit

Permalink
path-finding rework started
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorPhilipp committed May 2, 2017
1 parent 94d1a12 commit 77598e4
Show file tree
Hide file tree
Showing 37 changed files with 4,778 additions and 1,151 deletions.
8 changes: 8 additions & 0 deletions TLM/TLM/Custom/AI/CustomRoadAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ private static void GetCustomTrafficLightState(ushort vehicleId, ref Vehicle veh
// get responsible traffic light
//Log._Debug($"GetTrafficLightState: Getting custom light for vehicle {vehicleId} @ node {nodeId}, segment {fromSegmentId}, lane {fromLaneIndex}.");
SegmentGeometry geometry = SegmentGeometry.Get(fromSegmentId);
if (geometry == null) {
pedestrianLightState = TrafficLightState.Green;
Log.Error($"GetTrafficLightState: No geometry information @ node {nodeId}, segment {fromSegmentId}.");
vehicleLightState = TrafficLightState.Green;
pedestrianLightState = TrafficLightState.Green;
return;
}

// determine node position at `fromSegment` (start/end)
bool isStartNode = geometry.StartNodeId() == nodeId;

Expand Down
4 changes: 2 additions & 2 deletions TLM/TLM/Custom/Manager/CustomNetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void CustomFinalizeSegment(ushort segment, ref NetSegment data) {
if (GlobalConfig.Instance.DebugSwitches[5])
Log.Warning($"CustomNetManager: CustomFinalizeSegment {segment}");
#endif
SegmentGeometry.Get(segment)?.Recalculate(GeometryCalculationMode.Propagate);
SegmentGeometry.Get(segment, true).StartRecalculation(GeometryCalculationMode.Propagate);
} catch (Exception e) {
Log.Error($"Error occured in CustomNetManager.CustomFinalizeSegment @ seg. {segment}: " + e.ToString());
}
Expand All @@ -67,7 +67,7 @@ public void CustomUpdateSegment(ushort segment, ushort fromNode, int level) {
if (GlobalConfig.Instance.DebugSwitches[5])
Log.Warning($"CustomNetManager: CustomUpdateSegment {segment}");
#endif
SegmentGeometry.Get(segment)?.Recalculate(GeometryCalculationMode.Propagate);
SegmentGeometry.Get(segment, true).StartRecalculation(GeometryCalculationMode.Propagate);
} catch (Exception e) {
Log.Error($"Error occured in CustomNetManager.CustomUpdateSegment @ seg. {segment}: " + e.ToString());
}
Expand Down
1,204 changes: 174 additions & 1,030 deletions TLM/TLM/Custom/PathFinding/CustomPathFind.cs

Large diffs are not rendered by default.

Loading

0 comments on commit 77598e4

Please sign in to comment.