1classdef FiniteCapacityRegion < handle
2 % A finite capacity region
4 % Copyright (c) 2012-2026, Imperial College London
27 self.nodes = {
nodes{:}}
';
28 self.classes = classes;
29 self.globalMaxJobs = FiniteCapacityRegion.UNBOUNDED;
30 self.globalMaxMemory = FiniteCapacityRegion.UNBOUNDED;
31 self.classWeight = ones(1,length(self.classes));
32 self.dropRule = DropStrategy.WAITQ * ones(1,length(self.classes));
33 self.classSize = ones(1,length(self.classes));
34 self.classMaxJobs = FiniteCapacityRegion.UNBOUNDED * ones(1,length(self.classes));
35 self.classMaxMemory = FiniteCapacityRegion.UNBOUNDED * ones(1,length(self.classes));
38 function self = setGlobalMaxJobs(self, njobs)
39 self.globalMaxJobs = njobs;
42 function self = setGlobalMaxMemory(self, memlim)
43 self.globalMaxMemory = memlim;
46 function self = setClassMaxJobs(self, class, njobs)
47 self.classMaxJobs(class.index) = njobs;
50 function self = setClassWeight(self, class, weight)
51 self.classWeight(class.index) = weight;
54 function self = setDropRule(self, class, dropStrategy)
55 % SELF = SETDROPRULE(CLASS, DROPSTRATEGY)
56 % Set the drop rule for a class.
57 % dropStrategy can be:
58 % - A boolean: true = DROP, false = WAITQ (for backwards compatibility)
59 % - A DropStrategy enum value: DROP, WAITQ, BAS, BBS, RSRD
60 if islogical(dropStrategy)
62 self.dropRule(class.index) = DropStrategy.DROP;
64 self.dropRule(class.index) = DropStrategy.WAITQ;
67 self.dropRule(class.index) = dropStrategy;
71 function strategy = getDropRule(self, class)
72 % STRATEGY = GETDROPRULE(CLASS)
73 % Get the drop strategy for a class.
74 strategy = self.dropRule(class.index);
77 function self = setClassSize(self, class, size)
78 self.classSize(class.index) = size;
81 function self = setClassMaxMemory(self, class, memlim)
82 self.classMaxMemory(class.index) = memlim;
85 function self = setName(self, name)
89 function name = getName(self)