bkhnk48 / pathPlanningSimulation

1 stars 0 forks source link

fix bug NoneType object access #48

Open bkhnk48 opened 1 month ago

bkhnk48 commented 1 month ago
leegie@leegies-MacBook-Pro pps % python3 main.py
Choose the method for solving:
1 - Use LINK II solver
2 - Use network-simplex
Enter your choice (1 or 2): 1
Nhap ten file can thuc hien (hint: Redundant3x3Wards.txt): 
Nhap thoi gian can gia lap (default: 10): 800
Nhap time unit (default: 1): 10
Running ForecastingModel...
Run time: 1.3823931217193604 SEC

Solver time: 0.25186
Total time: 1.371599
Reading time: 0.0
Presolving time: 0.222325
Optimal value: 505.0
Solution:
x1_1_649 = 1.0
x1_649_1290 = 1.0
x1_1290_8331 = 1.0
x1_8331_8963 = 1.0
x1_8963_51265 = 1.0
x10_10_7051 = 1.0
x10_7051_7683 = 1.0
x10_7683_51266 = 1.0
1723798102115
['x1', '1', '649']
['x1', '649', '1290']
['x1', '1290', '8331']
['x1', '8331', '8963']
['x1', '8963', '51265']
['x10', '10', '7051']
['x10', '7051', '7683']
['x10', '7683', '51266']
====> {'x1': [(1, 649, 10), (649, 1290, 10), (1290, 8331, 110), (8331, 8963, 10), (8963, 51265, 134)], 'x10': [(10, 7051, 110), (7051, 7683, 10), (7683, 51266, 111)]}
version of graph : -1
(time=[0, 0], agv_id=AGV1) 0 0
> /Users/leegie/Documents/GitHub/AGV/pps/model/Event.py(190)setTracesForAllAGVs()
-> self.graph.setTrace("traces.txt")
(Pdb) c
1097
Running ForecastingModel...
No solution found
1723798135997
No solution found
version of graph : 1
(time=[0, 17], agv_id=AGV1) 0 17
> /Users/leegie/Documents/GitHub/AGV/pps/model/Event.py(190)setTracesForAllAGVs()
-> self.graph.setTrace("traces.txt")
(Pdb) c
Traceback (most recent call last):
  File "/Users/leegie/Documents/GitHub/AGV/pps/main.py", line 76, in <module>
    simulator.run()
  File "/Users/leegie/anaconda3/lib/python3.11/site-packages/discrevpy/simulator.py", line 246, in run
    next_event[3](*next_event[4], **next_event[5])
  File "/Users/leegie/Documents/GitHub/AGV/pps/model/MovingEvent.py", line 55, in process
    self.getNext()
  File "/Users/leegie/Documents/GitHub/AGV/pps/model/Event.py", line 108, in getNext
    self.find_path(DimacsFileReader, ForecastingModel)
  File "/Users/leegie/Documents/GitHub/AGV/pps/model/Event.py", line 143, in find_path
    self.setTracesForAllAGVs()
  File "/Users/leegie/Documents/GitHub/AGV/pps/model/Event.py", line 193, in setTracesForAllAGVs
    self.agv.target_node = self.agv.traces[len(self.agv.traces) - 1]
                                           ^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()