Skip to content

Commit

Permalink
Update JSSPActivity.m
Browse files Browse the repository at this point in the history
  • Loading branch information
iamaya2 committed Jan 14, 2021
1 parent 02d66af commit 272f12d
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions JSSPActivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
% JSSPActivity Properties:
% machineID - Information about the machine (its ID) where the
% activity must be scheduled.
% processingTime -
% processingTime - Ammount of time units that the activity requires
% for completion, i.e., its processing time.
% isScheduled - Boolean flag indicating whether the activity has been
% already scheduled (e.g. when solving the instance).
% startTime - Number indicating the time instant at which the
% activity starts (when it has been scheduled).
%
% JSSPActivity Methods:
% JSSPActivity Dependant Properties:
% endTime - Time instant at which the activity ends (=startTime +
% processingTime).
%
% These objects created have to vectors of the same lenght, one with the schedule in terms of
% machines (machine ID) and other with the processing times of the
% operations to be processed in those machines (processingTime).
% JSSPActivity Methods:
% JSSPActivity - Constructor. Receives two elements: the machine ID
% and the processing time.
%
% See also: JSSPJOB, JSSPMACHINE
properties
machineID %This property contains a vector with the order in which machines will be scheduled
Expand All @@ -29,20 +37,28 @@

methods
function activityObj = JSSPActivity(machID, procTime)
%This function inherit the machID from heuristics methods and
%the processing time from the instance.
% JSSPActivity Constructor. Receives ID and processing time.
% This method should work properly if given vectors of IDs
% and processing times. In this case, it should return a
% vector of JSSPActivity objects.
if nargin > 0
nbAct = length(machID);
activityObj(nbAct) = activityObj;
% activityObj(nbAct) = activityObj; % Leave this here just in
% case something breaks with the update
activityObj(nbAct) = JSSPActivity(); % Dummy activity for reserving memory
for idx = 1 : nbAct
activityObj(idx) = activityObj;
% activityObj(idx) = activityObj; % Leave this here just in
% case something breaks with the update
activityObj(idx) = JSSPActivity();
activityObj(idx).machineID = machID(idx);
activityObj(idx).processingTime = procTime(idx);
end
end
end

function endTime = get.endTime(obj)
% get.endTime Method for calculating the dependent property
% endTime.
endTime = obj.startTime + obj.processingTime;
end
end
Expand Down

0 comments on commit 272f12d

Please sign in to comment.