1function plotGraphSimple(self, method)
2% PLOTGRAPHSIMPLE(SELF, METHOD)
4% Plot graph without colors, suitable
for inclusion in scientific papers
5% METHOD: hashnames, names, hashids, ids
7% Copyright (c) 2012-2026, Imperial College London
10if nargin<2 %~exist(
'useNodes',
'var')
18 case {
'nodes',
'hashnames'}
19 lqn.hashnames = strrep(lqn.hashnames,
'\_',
'_'); % remove escaping
if it exists
20 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');
29 hashids = lqn.hashnames;
30 for i=1:length(lqn.hashnames)
31 hashids{i} = [lqn.hashnames{i}(1:2),num2str(i)];
33 h = plot(digraph(T),
'Layout',
'layered',
'NodeLabel',hashids);
35title([
'Model: ',self.name]);
37%
for r=find(lqnGraph.Edges.Pre==1)
' %AndFork
38% highlight(h,lqnGraph.Edges.EndNodes(r,:),'EdgeColor
','m
')
40%for r=find(lqnGraph.Edges.Post==1)' % AndJoin
41% highlight(h,lqnGraph.Edges.EndNodes(r,:),
'EdgeColor',
'm')
44for r=find(lqn.type==LayeredNetworkElement.HOST)
'
46 highlight(h,r,'NodeColor
','black
');
50for r=find(lqn.type==LayeredNetworkElement.ACTIVITY)'
52 highlight(h,r,
'NodeColor',
'black');
56for r=find(lqn.type==LayeredNetworkElement.ACTIVITY)
'
57 p = find(lqn.graph(:,r))';
59 switch lqn.actpretype(r)
60 case ActivityPrecedenceType.PRE_AND
61 % highlight(h,p,
'Marker',
'o');
64 p = find(lqn.graph(r,:))
';
66 switch lqn.actposttype(r)
67 case ActivityPrecedenceType.POST_AND
68 % highlight(h,p,'Marker
','o
');
73for r=find(lqn.type==LayeredNetworkElement.TASK)'
76 highlight(h,r,
'NodeColor',
'black');
78 highlight(h,r,
'NodeColor',
'black');
83for r=find(lqn.type==LayeredNetworkElement.ENTRY)
'
85 highlight(h,r,'NodeColor
','black
');
89mult = nan(lqn.nidx,1);
90mult(1:(lqn.tshift+lqn.ntasks),1)=lqn.mult;
91row = dataTipTextRow('multiplicity
',mult);
92h.DataTipTemplate.DataTipRows(2) = row;
94for i=1:length(lqn.hostdem)
95 if ~isempty(lqn.hostdem{i})
96 D(i) = lqn.hostdem{i}.getMean;
99row = dataTipTextRow('hostDemand
',D);
100h.DataTipTemplate.DataTipRows(end+1) = row;
101sched = cell(lqn.nidx,1);
105sched(1:(lqn.tshift+lqn.ntasks),1)=lqn.sched;
106row = dataTipTextRow('scheduling
',sched);
107h.DataTipTemplate.DataTipRows(end+1) = row;