Closed pedrolbacelar closed 1 year ago
-------------------------------------
28 March 17:47:13 |[interfaceDB.py/update_end_time] Pointer End Time updated from 140 to 141
-------- Printing the traces: --------
(129, None, 'Machine 2', 'Started', 'Part 20', 'Queue 2', '28 March 17:46:21', 1680021981)
(130, None, 'Machine 1', 'Started', 'Part 23', 'Queue 1', '28 March 17:46:25', 1680021985)
(131, None, 'Machine 3', 'Finished', 'Part 12', 'Queue 5', '28 March 17:46:34', 1680021994)
(132, None, 'Machine 3', 'Started', 'Part 15', 'Queue 1', '28 March 17:46:35', 1680021995)
(133, None, 'Machine 2', 'Finished', 'Part 20', 'Queue 3', '28 March 17:46:38', 1680021999)
(134, None, 'Machine 1', 'Finished', 'Part 23', 'Queue 2', '28 March 17:46:38', 1680021999)
(135, None, 'Machine 2', 'Started', 'Part 21', 'Queue 2', '28 March 17:46:39', 1680022000)
(136, None, 'Machine 5', 'Started', 'Part 12', 'Queue 1', '28 March 17:46:41', 1680022002)
(137, None, 'Machine 4', 'Finished', 'Part 13', 'Queue 5', '28 March 17:46:41', 1680022002)
(138, None, 'Machine 4', 'Started', 'Part 14', 'Queue 1', '28 March 17:46:42', 1680022003)
(139, None, 'Machine 5', 'Finished', 'Part 12', 'Queue 1', '28 March 17:46:49', 1680022010)
(140, None, 'Machine 5', 'Started', 'Part 13', 'Queue 1', '28 March 17:46:50', 1680022011)
(141, None, 'Machine 2', 'Finished', 'Part 21', 'Queue 4', '28 March 17:46:57', 1680022018)
---------- Pointer Status Updated ----------
Start Time: 1680021981
Start Time ID: 129
End Time: 1680022018
End Time ID: 141
-------------------------------------
parts_zero: []
Printing unique machines ids with completed traces
('Machine 2',)
('Machine 5',)
machine name: Machine 2
Xr_vector: [18, 18]
28 March 17:47:13 |[ERROR][validator.py/generate_Xs_machine()] value 1 not found in 'u' variable
u: [0.5, 0.5]
Printing input parameters...
loc = 16
scale = 2
distribution= norm
Xr = [18, 18]
28 March 17:47:13 |[ERROR][validator.py/generate_Xs_machine()] The Xs vector is not a made by numbers! Check the U vector:
u: [0.5, 0.5]
|--- Printing input parameters...
loc = 16
scale = 2
distribution= norm
Xr = [18, 18]
|--- Printing output
Xs= [16. 16.]
machine name: Machine 5
Xr_vector: [8]
28 March 17:47:13 |[ERROR][validator.py/generate_Xs_machine()] The Xs vector is not a made by numbers! Check the U vector:
u: [0.9599]
|--- Printing input parameters...
loc = 10
scale = 0
distribution= norm
Xr = [8]
|--- Printing output
Xs= [nan]
Printing unique machines ids with completed traces
('Machine 2',)
('Machine 5',)
Traceback (most recent call last):
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\testing_stho.py", line 31, in <module>
mydt.run()
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\dtwinpylib\dtwinpy\Digital_Twin.py", line 845, in run
self.Internal_Services()
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\dtwinpylib\dtwinpy\Digital_Twin.py", line 601, in Internal_Services
[lcss_indicator_logic, lcss_indicator_input] = self.run_validation(copied_realDB= self.copied_realDB, start_time= start_time, end_time= end_time)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\dtwinpylib\dtwinpy\Digital_Twin.py", line 423, in run_validation
(lcss_input, lcss_time_input, lcss_indicator_input) = validator_input.run()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\dtwinpylib\dtwinpy\validator.py", line 810, in run
(lcss, lcss_time, lcss_indicator) = self.LCSS(Sequence1= Ys_event, Sequence1_time= Ys_time, Sequence2= Yr_event, Sequence2_time= Yr_time, delta_t= self.delta_t_treshold)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\pedro\Github_repos\Digital_Twin\Digital Twin\dtwinpylib\dtwinpy\validator.py", line 602, in LCSS
if (Sequence1[i-1] == Sequence2[j-1]) and (abs(Sequence1_time[i-1] - Sequence2_time[j-1]) <= delta_t):
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Basically when trying to run validation qTDS some machines was receiving None as process time correlated given the output of the function: generate_Xs_machine(self, loc, scale, distribution, Xr, a= None, b= None)
This was happening because Xs = (dist.ppf(u, loc, scale))
was return infinity. This is explained when we start printing the input parameter when we received that error. Than we noticed that for those cases the scale being passed was 0, which doesnt make sense to find a distribution. The scale was zero from the model.
The updator was receiving only one trace (one process time) and because of that the scale was being updated to zero.
Solve that problem we just always update the scale to 1 if it was suppose to be 0.