-
Notifications
You must be signed in to change notification settings - Fork 5
/
SimpleSlice.m
75 lines (69 loc) · 2.42 KB
/
SimpleSlice.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
64
65
66
67
68
69
70
71
72
73
74
75
%% Network Slice
% Support network resource allocation scheme.
%%
classdef SimpleSlice < Slice
properties (Access = protected)
% link_load; % temporary results of link load.
% node_load; % temporary results of node load.
end
properties(Dependent, GetAccess={?CloudNetwork})
% local_path_id;
end
methods
function this = SimpleSlice(slice_data)
if nargin == 0
args = cell(0);
else
args = {slice_data};
end
this@Slice(args{:});
end
end
%% Public Methods
methods
function op = getOptimizer(this, options)
if nargin == 1
this.op = SimpleSliceOptimizer(this);
else
this.op = SimpleSliceOptimizer(this, options);
end
op = this.op;
op.initializeState();
end
end
methods (Access = private)
%%
% function sc = getResourceCost(this, load, model)
% if nargin <= 1 || isempty(load)
% load.Node = this.Nodes.Load;
% load.Link = this.Links.Load;
% end
% if nargin <= 2
% warning('model is set as Approximate.');
% model = 'Approximate';
% end
%
% pn = this.Parent;
% link_uc = pn.getLinkCost(this.Links.PhysicalLink); % the virtual links's unit cost
% node_uc = pn.getNodeCost(this.getDCPI); % the virtual nodes's unit cost
% epsilon = pn.unitStaticNodeCost;
%
% if strcmp(model, 'Approximate')
% sc = dot(link_uc, load.Link) + dot(node_uc, load.Node) ...
% + pn.phis_n*sum(load.Node)+pn.phis_l*sum(load.Link)+...
% pn.static_factor*epsilon/pn.NumberSlices;
% elseif strcmp(model, 'Accurate')
% sc = dot(link_uc, load.Link) + dot(node_uc, node_load);
% else
% error('error: invalid model %s', model);
% end
% end
%%%
% When compute the static cost, the Capacity of all physical nodes and links is
% included.
% |epsilon/pn.NumberSlices| is a constant. To keep consistence with other methods,
% this part should not be ignored. See also <totalCost> and <getStaticCost>.
% The calculation is not absolutely precise, since it cannot be decide that the
% static cost should be arributed to which slices.
end
end