eenie_meenie 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  EenieMeenie
2
2
  ========
3
3
 
4
- This tool was written in order to play with some simple methods for assigning members of a population to one of two groups. The goal is to provide an algorithm that will limit the user's ability to predict which group a member will be assigned.
4
+ This tool was written in order to play with some simple methods for assigning members of a population to one of two groups. The goal was initially to provide an algorithm that would limit the user's ability to predict to which group a member will be assigned.
5
5
 
6
6
  Installation
7
7
  ------------
@@ -30,13 +30,13 @@ Example Configurations
30
30
  # Experimental A: %50 (randomly assign)
31
31
  # Experimental B: %50 (randomly assign)
32
32
 
33
- EenieMeenie::Assignment.new({
33
+ EenieMeenie::PolyAssignment.new({
34
34
  groups: ["Experimental A", "Experimental B"], # EenieMeenie's assignment options
35
35
  member: @obj, # Member of population
36
36
  group_rules: {
37
- "Control" => { threshold: false }, # Don't care
38
- "Full-Incentive" => { threshold: 0.5 }, # No more than 50%
39
- "Split-Incentive" => { threshold: 0.5 } # No more than 50%
37
+ "Control" => { threshold: false }, # Don't care
38
+ "Experimental A" => { threshold: 0.5 }, # No more than 50%
39
+ "Experimental B" => { threshold: 0.5 } # No more than 50%
40
40
  },
41
41
  class_rules: { organization_id: 1} # Only consider members belonging to Organization 1
42
42
  }).execute!
@@ -47,13 +47,13 @@ EenieMeenie::Assignment.new({
47
47
  # Experimental A: %33.3 (randomly assign)
48
48
  # Experimental B: %33.3 (randomly assign)
49
49
 
50
- EenieMeenie::Assignment.new({
50
+ EenieMeenie::PolyAssignment.new({
51
51
  groups: ["Control", "Experimental A", "Experimental B"], # EenieMeenie's assignment options
52
52
  member: @obj, # Member of population
53
53
  group_rules: {
54
54
  "Control" => { threshold: (1.0 / 3.0) }, # No more than one-third
55
- "Full-Incentive" => { threshold: (1.0 / 3.0) }, # No more than one-third
56
- "Split-Incentive" => { threshold: (1.0 / 3.0) } # No more than one-third
55
+ "Experimental A" => { threshold: (1.0 / 3.0) }, # No more than one-third
56
+ "Experimental B" => { threshold: (1.0 / 3.0) } # No more than one-third
57
57
  },
58
58
  class_rules: { organization_id: 1} # Only consider members belonging to Organization 1
59
59
  }).execute!
@@ -69,7 +69,7 @@ EenieMeenie::Assignment.new({
69
69
  # Later someone will choose whether they're in "Experimental A" ...
70
70
  # or in "Experimental B"
71
71
 
72
- EenieMeenie::Assignment.new({
72
+ EenieMeenie::PolyAssignment.new({
73
73
  groups: ["Control", "Experimental"], # EenieMeenie's assignment options
74
74
  member: @obj, # Member of population
75
75
  group_rules: {
@@ -32,6 +32,8 @@ module EenieMeenie
32
32
  @group_candidates ||= @group_rules.reject { |k,v|
33
33
  v[:threshold] && (v[:count] / @members.count.to_f) >= v[:threshold]
34
34
  }.keys.map(&:to_s)
35
+
36
+ @group_candidates.select {|cand| @groups.include?(cand) }
35
37
  end
36
38
 
37
39
  def random_group
@@ -1,3 +1,3 @@
1
1
  module EenieMeenie
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: eenie_meenie
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tad Hosford