-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawres.m
31 lines (30 loc) · 951 Bytes
/
drawres.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
%Author: Zsolt T. Kosztyán Ph.D habil., University of Pannonia,
%Faculty of Economics, Department of Quantitative Methods
%----------------
%Draw the resource diagram
%----------------
%Input:
%BP: vector of breakpoints in resource diagram
%RESFUNC: matrix of resource demands (resource demands in breakpoints)
%----------------
%Usage:
%drawres(BP,RESFUNC)
%----------------
%Example: draw resource demands for tasks, which scheduled as early as
%possible
%DSM=triu(round(rand(10))); T=rand(10,1)*20; R=rand(10,3)*5; %generate
%initial domains
%[~,EST,~,~,~]=tptfast(DSM,T); %calculate EST
%[BP,RESFUNC]=resfunc(DSM,EST,T,R); %calculate BP and RESFUNC
%figure('Name','EST');
%drawres(BP,RESFUNC);
function drawres(BP,RESFUNC)
resources=numel(RESFUNC(1,:));
for i=1:resources
subplot(resources,1,i)
stairs(BP,RESFUNC(:,i));
title(strcat('r_',num2str(i)));
xlabel('day');
ylabel('resource');
end
end