summaryrefslogtreecommitdiffstats
path: root/examples/placement-models-minizinc/vdns-use-case
diff options
context:
space:
mode:
authorramkri123 <ramkri123@gmail.com>2018-02-27 14:52:49 -0800
committerramkri123 <ramkri123@gmail.com>2018-02-27 15:15:21 -0800
commitaa358e298d345da0582ad1ea3b496bb44650a4f1 (patch)
tree3d4bf5484b53f9379ddf1b85f4d56565cbe2794a /examples/placement-models-minizinc/vdns-use-case
parentf2541009309551548ed3567adbdc8f2e5b78d185 (diff)
Minizinc Placement Model Ex. for vDNS+vFW use case
Issue-ID: OPTFRA-153 Change-Id: I228e638e4c5bfb2cabd970c571077f3ebaf01ece Signed-off-by: ramkri123 <ramkri123@gmail.com>
Diffstat (limited to 'examples/placement-models-minizinc/vdns-use-case')
-rw-r--r--examples/placement-models-minizinc/vdns-use-case/vDNS-service-gold-customer-model-driven-placement.dzn16
-rw-r--r--examples/placement-models-minizinc/vdns-use-case/vDNS-service-model-driven-placement.mzn40
-rw-r--r--examples/placement-models-minizinc/vdns-use-case/vDNS-service-no-edge-dc-model-driven-placement.dzn16
-rw-r--r--examples/placement-models-minizinc/vdns-use-case/vDNS-service-silver-customer-model-driven-placement.dzn16
4 files changed, 88 insertions, 0 deletions
diff --git a/examples/placement-models-minizinc/vdns-use-case/vDNS-service-gold-customer-model-driven-placement.dzn b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-gold-customer-model-driven-placement.dzn
new file mode 100644
index 0000000..6a3222f
--- /dev/null
+++ b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-gold-customer-model-driven-placement.dzn
@@ -0,0 +1,16 @@
+N_CLOUD_REGIONS = 3; % e-dc-1, core-dc-1, core-dc-2
+N_ATTRIBUTES = 4;
+N_METRICS = 2;
+
+CUST_TYPE = GOLD;
+
+W_METRICS = [0.9, 0.1];
+W_ATTRIBUTES = [0, 0.9, 0.05, 0.05];
+
+capabilities = [| 0, 0, 1, 1
+ | 1, 0, 1, 1
+ | 1, 1, 0, 1 |];
+
+utilization = [| 0.05, 0.9
+ | 0.1, 0.5
+ | 0.8, 0.98 |];
diff --git a/examples/placement-models-minizinc/vdns-use-case/vDNS-service-model-driven-placement.mzn b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-model-driven-placement.mzn
new file mode 100644
index 0000000..08292be
--- /dev/null
+++ b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-model-driven-placement.mzn
@@ -0,0 +1,40 @@
+int: N_CLOUD_REGIONS; % number of cloud regions
+
+int: N_ATTRIBUTES; % number of capability related attributes
+array[1..N_ATTRIBUTES] of float: W_ATTRIBUTES; % weights of each attribute
+
+int: N_METRICS; % number of dynamic capacity metrics of interest
+array[1..N_METRICS] of float: W_METRICS; % weights of each capacity metric
+
+int: CUST_TYPE; % customer type, 0 = regular, 1 = silver, 2 = gold
+
+enum CUST_TYPES = { STANDARD, SILVER, GOLD };
+enum ATTRIBUTES = { CORE_DC, DIRECT_CONN, MIN_GUARANTEE, SRIOV };
+enum METRICS = { AVG_UTILIZATION, PEAK_UTILIZATION };
+
+% whether a cloud region has the corresponding capability -- data will be customer specific
+array[1..N_CLOUD_REGIONS, 1..N_ATTRIBUTES] of int: capabilities;
+array[1..N_CLOUD_REGIONS, 1..N_METRICS] of float: utilization; % how much capacity is already utilized (fraction)
+
+var int: s; % target cloud region (solution to the problem)
+
+% custom constraints
+constraint capabilities[s, CORE_DC] = 1; % hard constraint: has to be placed in CORE DC
+constraint utilization[s, AVG_UTILIZATION] <= 0.85; % hard constraint: need some capacity available
+% custom soft constraint for gold customers -- give a large weight to direct connection
+var float: additional_obj = bool2int(CUST_TYPE = GOLD) * capabilities[s, DIRECT_CONN] * 1000;
+
+% TODO: global constraints (such as data validation)
+
+% Objective for utilization
+var float: obj_utilization = sum(k in 1..N_METRICS) ( W_METRICS[k] * (1 - utilization[s, k]) );
+
+% Objective for capabilities
+var float: obj_capabilities = sum(k in 1..N_ATTRIBUTES) ( W_ATTRIBUTES[k] * capabilities[s, k] );
+
+% Overall objective function
+var float: obj = obj_utilization + obj_capabilities + additional_obj; % can later add weights to each...
+
+solve maximize obj;
+
+output ["Cloud Region: ", show(s), "\n", "Objective function value: ", show(obj), "\n", "Customer type: ", show(CUST_TYPE), "\n"];
diff --git a/examples/placement-models-minizinc/vdns-use-case/vDNS-service-no-edge-dc-model-driven-placement.dzn b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-no-edge-dc-model-driven-placement.dzn
new file mode 100644
index 0000000..3a2a000
--- /dev/null
+++ b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-no-edge-dc-model-driven-placement.dzn
@@ -0,0 +1,16 @@
+N_CLOUD_REGIONS = 3; % e-dc-1, core-dc-1, core-dc-2
+N_ATTRIBUTES = 4;
+N_METRICS = 2;
+
+CUST_TYPE = GOLD;
+
+W_METRICS = [0.9, 0.1];
+W_ATTRIBUTES = [0, 0.9, 0.05, 0.05];
+
+capabilities = [| 0, 0, 1, 1
+ | 1, 0, 1, 1
+ | 1, 1, 0, 1 |];
+
+utilization = [| 0.05, 0.9
+ | 0.1, 0.5
+ | 0.95, 1.0 |];
diff --git a/examples/placement-models-minizinc/vdns-use-case/vDNS-service-silver-customer-model-driven-placement.dzn b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-silver-customer-model-driven-placement.dzn
new file mode 100644
index 0000000..c99bb99
--- /dev/null
+++ b/examples/placement-models-minizinc/vdns-use-case/vDNS-service-silver-customer-model-driven-placement.dzn
@@ -0,0 +1,16 @@
+N_CLOUD_REGIONS = 3; % e-dc-1, core-dc-1, core-dc-2
+N_ATTRIBUTES = 4;
+N_METRICS = 2;
+
+CUST_TYPE = SILVER;
+
+W_METRICS = [0.9, 0.1];
+W_ATTRIBUTES = [0, 0.9, 0.05, 0.05];
+
+capabilities = [| 0, 0, 1, 1
+ | 1, 0, 1, 1
+ | 1, 0, 1, 1 |];
+
+utilization = [| 0.05, 0.9
+ | 0.1, 0.5
+ | 0.8, 0.98 |];