gthc 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcebf62fac658df3fa6036907c8521606996b282f20be727dbe7672089605d94
4
- data.tar.gz: 33b3003c98eca4dc25e7632e0ab03600a26c38d256043a2bf7fbe1c4b5598858
3
+ metadata.gz: a2e103bce21ce82dd8082748418964a84adbd9fbe63463f9367d15ca5569a836
4
+ data.tar.gz: 02ed1d95f8e4e6b4214c08e974cf3fbc6289a9bb4f36eea8397fe697f08bcb87
5
5
  SHA512:
6
- metadata.gz: 8c5aa1eb665381bbfb66924e0c3f217250a841e68fb54841fd374bf67222e3fba31deec1a5cb18fb5e7270b4773722a1a6fe4d7c817666517da83a898644ffe2
7
- data.tar.gz: dd1e5142b8e1ca81dc2d0e33538849737bb7ba186ea275377b9b4f0020e17a73a2f374b54f76d5d8ba968324983ace3cdcbe0f4889747b2b54986ecfea476484
6
+ metadata.gz: 1ffd8db92c841b2402a4f798d04b45d7d0a65de10ba60ce8809b1e6e55add6a1d6266602baaa2e2b637f59a35f09064a241690bc2179b934905b17e0e17a926f
7
+ data.tar.gz: 8bec0fc03302185d5b09ff08809497e880fcf89d9e4d1050517222dc730b941a584ab9ff18ac28c1a14372f1f8ec182fb1e1c1c9c07f61a0397c89c179d58fe7
@@ -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, graveyard = Weight.weightContiguous(slots, scheduleGrid, graveyard)
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)
@@ -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, graveyard)
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, graveyard
160
+ return slots, scheduleGrid
153
161
  end
154
162
 
155
163
  # Weight Tough Time - prioritize time slots with few people available. */
@@ -1,3 +1,3 @@
1
1
  module GTHC
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
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-10 00:00:00.000000000 Z
12
+ date: 2019-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler