gthc 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gthc/olson/algorithm.rb +1 -1
- data/lib/gthc/olson/weight.rb +10 -2
- data/lib/gthc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e103bce21ce82dd8082748418964a84adbd9fbe63463f9367d15ca5569a836
|
4
|
+
data.tar.gz: 02ed1d95f8e4e6b4214c08e974cf3fbc6289a9bb4f36eea8397fe697f08bcb87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ffd8db92c841b2402a4f798d04b45d7d0a65de10ba60ce8809b1e6e55add6a1d6266602baaa2e2b637f59a35f09064a241690bc2179b934905b17e0e17a926f
|
7
|
+
data.tar.gz: 8bec0fc03302185d5b09ff08809497e880fcf89d9e4d1050517222dc730b941a584ab9ff18ac28c1a14372f1f8ec182fb1e1c1c9c07f61a0397c89c179d58fe7
|
data/lib/gthc/olson/algorithm.rb
CHANGED
@@ -23,7 +23,7 @@ module Algorithm
|
|
23
23
|
people, slots = Weight.weightBalance(people, slots)
|
24
24
|
|
25
25
|
# Weight Contiguous - prioritize people to stay in the tent more time at once.
|
26
|
-
slots, scheduleGrid
|
26
|
+
slots, scheduleGrid = Weight.weightContiguous(slots, scheduleGrid, people)
|
27
27
|
|
28
28
|
# Weight Tough Time - prioritize time slots with few people available.
|
29
29
|
slots = Weight.weightToughTime(slots, scheduleLength)
|
data/lib/gthc/olson/weight.rb
CHANGED
@@ -55,7 +55,7 @@ module Weight
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Weight Contiguous - prioritize people to stay in the tent more time at once.
|
58
|
-
def self.weightContiguous(slots, scheduleGrid,
|
58
|
+
def self.weightContiguous(slots, scheduleGrid, people)
|
59
59
|
|
60
60
|
i = 0
|
61
61
|
while i < slots.length
|
@@ -144,12 +144,20 @@ module Weight
|
|
144
144
|
multi *= 0.5
|
145
145
|
end
|
146
146
|
|
147
|
+
# multi based on person
|
148
|
+
person = people[slots[i].personID]
|
149
|
+
if slots[i].isNight && person.nightScheduled > 0
|
150
|
+
multi *= (1/person.nightScheduled)
|
151
|
+
elsif person.dayScheduled > 0
|
152
|
+
multi *= (1/person.dayScheduled)
|
153
|
+
end
|
154
|
+
|
147
155
|
slots[i].weight = slots[i].weight*multi
|
148
156
|
i += 1
|
149
157
|
|
150
158
|
end
|
151
159
|
|
152
|
-
return slots, scheduleGrid
|
160
|
+
return slots, scheduleGrid
|
153
161
|
end
|
154
162
|
|
155
163
|
# Weight Tough Time - prioritize time slots with few people available. */
|
data/lib/gthc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gthc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Ibrahim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-12-
|
12
|
+
date: 2019-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|