1function plotGraph(self, method)
2% PLOTGRAPH(SELF, METHOD)
4% METHOD:
nodes, names or ids
6% Copyright (c) 2012-2026, Imperial College London
9if nargin<2 %~exist(
'useNodes',
'var')
18 lqn.hashnames = strrep(lqn.hashnames,'\_','_'); % remove escaping if it exists
19 lqn.hashnames = strrep(lqn.hashnames,'_','\_'); % reapply it include to those which did not have it
21 h = plot(digraph(T),'Layout','layered','NodeLabel',lqn.hashnames);
23 lqn.names = strrep(lqn.names,'\_','_'); % remove escaping if it exists
24 lqn.names = strrep(lqn.names,'_','\_'); % reapply it include to those which did not have it
25 h = plot(digraph(T),'Layout','layered','NodeLabel',lqn.names);
27 h = plot(digraph(T),'Layout','layered');
29title(['Model: ', strrep(strrep(self.name, '\_', '_'), '_', '\_')]); % escape underscores
31%for r=find(lqnGraph.Edges.Pre==1)' %AndFork
32% highlight(h,lqnGraph.Edges.EndNodes(r,:),'EdgeColor','m')
34%for r=find(lqnGraph.Edges.Post==1)' % AndJoin
35% highlight(h,lqnGraph.Edges.EndNodes(r,:),'EdgeColor','m')
38for r=find(lqn.type==LayeredNetworkElement.HOST)'
40 highlight(h,r,'NodeColor','black','Marker','h');
44for r=find(lqn.type==LayeredNetworkElement.ACTIVITY)'
46 highlight(h,r,'NodeColor','blue','Marker','o');
50for r=find(lqn.type==LayeredNetworkElement.ACTIVITY)'
51 p = find(lqn.graph(:,r))';
53 switch lqn.actpretype(r)
54 case ActivityPrecedenceType.PRE_AND
55 % highlight(h,p,'NodeColor','magenta','Marker','o');
58 p = find(lqn.graph(r,:))';
60 switch lqn.actposttype(r)
61 case ActivityPrecedenceType.POST_AND
62 % highlight(h,p,'NodeColor','magenta','Marker','o');
67for r=find(lqn.type==LayeredNetworkElement.TASK)'
70 highlight(h,r,'NodeColor','
#EDB120','Marker','^');
72 highlight(h,r,
'NodeColor',
'magenta',
'Marker',
'v');
77for r=find(lqn.type==LayeredNetworkElement.ENTRY)
'
79 highlight(h,r,'NodeColor
','red
','Marker
','s
');
83mult = nan(lqn.nidx,1);
84mult(1:(lqn.tshift+lqn.ntasks),1)=lqn.mult;
85row = dataTipTextRow('Multiplicity
',mult);
86h.DataTipTemplate.DataTipRows(2) = row;
87maxmult = nan(lqn.nidx,1);
88maxmult(1:(lqn.tshift+lqn.ntasks),1)=lqn.maxmult;
89row = dataTipTextRow('maxMultiplicity
',maxmult);
90h.DataTipTemplate.DataTipRows(3) = row;
92for i=1:length(lqn.hostdem)
93 if ~isempty(lqn.hostdem{i})
94 D(i) = lqn.hostdem{i}.getMean;
97row = dataTipTextRow('hostDemand
',D);
98h.DataTipTemplate.DataTipRows(end+1) = row;
99sched = cell(lqn.nidx,1);
100for i=1:length(lqn.sched)
101 sched{i} = SchedStrategy.toText(lqn.sched(i));
103row = dataTipTextRow('scheduling
',sched);
104h.DataTipTemplate.DataTipRows(end+1) = row;