-
Notifications
You must be signed in to change notification settings - Fork 0
/
Technician_GB_GEN_MBI.m
63 lines (56 loc) · 2.49 KB
/
Technician_GB_GEN_MBI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
% Technician with maintenance-based inspection decision for gearbox
classdef Technician_GB_GEN_MBI < Technician
methods
function obj = Technician_GB_GEN_MBI (no_of_years)
obj = obj@Technician (no_of_years);
end
end
methods (Access = protected)
function [new_time turbine_state] = MainService (obj, turbine, t)
turbine_state = turbine.online;
turbine.off (t);
t = obj.RegularMaintenance (turbine, t);
% Inspect gearbox if the last inspection is at least
% comp.inspection_interval hours away
% change if it is defect and there is no change already scheduled
comp = turbine.components{4};
if comp.DoIntervalInspection(t)
[t, s] = obj.InspectComponent (comp, t);
if s == Constants.WTCOMPONENT_STATE_DEFECT
if comp.lead_time == 0
[t, ~] = obj.ChangeComponent (comp, t);
else
if ~comp.change_scheduled
obj.t_schedule.Add ([t + comp.lead_time, ...
Constants.SCHEDULE_COMPONENT_CHANGE, comp.id]);
comp.change_scheduled = true;
end
end
end
end
% Inspect generator if the last inspection is at least
% comp.inspection_interval hours away
% change if it is defect and there is no change already scheduled
comp = turbine.components{1};
if comp.DoIntervalInspection(t)
[t, s] = obj.InspectComponent (comp, t);
if s == Constants.WTCOMPONENT_STATE_DEFECT
if comp.lead_time == 0
[t, ~] = obj.ChangeComponent (comp, t);
else
if ~comp.change_scheduled
obj.t_schedule.Add ([t + comp.lead_time, ...
Constants.SCHEDULE_COMPONENT_CHANGE, comp.id]);
comp.change_scheduled = true;
end
end
end
end
obj.t_schedule.Add ([(t+turbine.main_service_intervall), Constants.SCHEDULE_MAIN_SERVICE, 0]);
if turbine_state
turbine.on (t);
end
new_time = t;
end
end
end