-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathISAP Optimization.page
132 lines (96 loc) · 2.62 KB
/
ISAP Optimization.page
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Generic model
=============
Model overview
--------------
```{.clafer .summary}
```
```{.clafer .mooviz}
```
Service prototype
-----------------
```clafer
abstract Service
requirements: Requirements // resources required by a service
machine -> Machine // machine the service is allocated to
[this in machine.services] // inverse relationship constraint
```
Requirements and Resources prototypes
----------------------------------
```clafer
abstract Requirements
cpu -> integer
abstract Resources : Requirements
```
Machine prototype
------------------
```clafer
abstract Machine
services -> Service*
[this.machine = Machine]
isFree?
[isFree <=> no services]
limits : Resources
utilization : Resources
[cpu = sum services.requirements.cpu]
[cpu < limits.cpu]
```
A machine is free when no services are allocated.
Utilization of the machine must satisfy limits.
Optimization goals and constraints
-----------------------------------
We want to maximize the number of free machines.
```clafer
Task
total_free -> integer = #Machine.isFree
<<max Task.total_free>>
```
ISAP problem specifics
======================
```clafer
abstract InterferenceData
memoryPressure ->> integer
memorySensitivity ->> integer
```
```clafer
abstract MachineISAP : Machine
interferenceSensitiveServices -> ServiceISAP*
[all s: services | (s in ServiceISAP) <=> (s in interferenceSensitiveServices)]
```
```clafer
abstract ServiceISAP: Service
interferenceData : InterferenceData
machineISAP -> MachineISAP // typecasting the machine to MachineISAP
[this = machine]
totalPressure -> integer = sum machineISAP.interferenceSensitiveServices.interferenceData.memoryPressure
memoryPressureToThisService -> integer = totalPressure - interferenceData.memoryPressure
// constraint:
[memoryPressureToThisService <= interferenceData.memorySensitivity]
```
Particular data (machines and services)
=======================================
Machines
--------
```clafer
GoogleCA : MachineISAP
[limits.cpu = 10]
GoogleNY : MachineISAP
[limits.cpu = 16]
GoogleTX : MachineISAP
[limits.cpu = 14]
```
Services
--------
```clafer
MailService : ServiceISAP
[requirements.cpu = 4]
[interferenceData.memoryPressure = 4]
[interferenceData.memorySensitivity = 6]
SearchService : ServiceISAP
[requirements.cpu = 3]
[interferenceData.memoryPressure = 4]
[interferenceData.memorySensitivity = 2]
CalendarService : Service
[requirements.cpu = 1]
DriveService : Service
[requirements.cpu = 2]
```