winston 0.0.1 → 0.1.0

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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winston
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Michael Nelson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2026-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,73 +16,97 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '2.4'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.4.22
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '1.3'
29
+ version: '2.4'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.4.22
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '0'
39
+ version: '13.1'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
44
+ - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: '0'
46
+ version: '13.1'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rspec
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '0'
53
+ version: '3.13'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: Constraint Satisfaction Problem (CSP) implementation for Ruby
56
- email:
60
+ version: '3.13'
61
+ description: A small, practical CSP library for Ruby with multiple solvers, heuristics,
62
+ and a DSL.
63
+ email:
57
64
  executables: []
58
65
  extensions: []
59
66
  extra_rdoc_files: []
60
67
  files:
61
68
  - ".gitignore"
69
+ - ".tool-versions"
70
+ - ".travis.yml"
71
+ - CHANGELOG.md
62
72
  - Gemfile
73
+ - Gemfile.lock
63
74
  - LICENSE
64
75
  - README.md
65
76
  - Rakefile
77
+ - bench/run.rb
66
78
  - lib/winston.rb
67
- - lib/winston/backtrack.rb
68
79
  - lib/winston/constraint.rb
69
80
  - lib/winston/constraints/all_different.rb
81
+ - lib/winston/constraints/not_in_list.rb
70
82
  - lib/winston/csp.rb
71
83
  - lib/winston/domain.rb
84
+ - lib/winston/dsl.rb
85
+ - lib/winston/heuristics.rb
86
+ - lib/winston/solvers/backtrack.rb
87
+ - lib/winston/solvers/mac.rb
88
+ - lib/winston/solvers/min_conflicts.rb
72
89
  - lib/winston/variable.rb
90
+ - spec/examples/map_coloring_spec.rb
73
91
  - spec/examples/numbers_spec.rb
92
+ - spec/examples/sudoku_spec.rb
74
93
  - spec/winston/backtrack_spec.rb
75
94
  - spec/winston/constraint_spec.rb
76
95
  - spec/winston/constraints/all_different_spec.rb
96
+ - spec/winston/constraints/not_in_list_spec.rb
77
97
  - spec/winston/csp_spec.rb
78
98
  - spec/winston/domain_spec.rb
99
+ - spec/winston/dsl_spec.rb
100
+ - spec/winston/heuristics_spec.rb
101
+ - spec/winston/mac_spec.rb
102
+ - spec/winston/min_conflicts_spec.rb
79
103
  - spec/winston/variable_spec.rb
80
104
  - winston.gemspec
81
105
  homepage: http://github.com/dmnelson/winston
82
106
  licenses:
83
107
  - MIT
84
108
  metadata: {}
85
- post_install_message:
109
+ post_install_message:
86
110
  rdoc_options: []
87
111
  require_paths:
88
112
  - lib
@@ -90,23 +114,29 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
114
  requirements:
91
115
  - - ">="
92
116
  - !ruby/object:Gem::Version
93
- version: '0'
117
+ version: '3.0'
94
118
  required_rubygems_version: !ruby/object:Gem::Requirement
95
119
  requirements:
96
120
  - - ">="
97
121
  - !ruby/object:Gem::Version
98
122
  version: '0'
99
123
  requirements: []
100
- rubyforge_project:
101
- rubygems_version: 2.2.2
102
- signing_key:
124
+ rubygems_version: 3.5.22
125
+ signing_key:
103
126
  specification_version: 4
104
127
  summary: Constraint Satisfaction Problem (CSP) implementation for Ruby
105
128
  test_files:
129
+ - spec/examples/map_coloring_spec.rb
106
130
  - spec/examples/numbers_spec.rb
131
+ - spec/examples/sudoku_spec.rb
107
132
  - spec/winston/backtrack_spec.rb
108
133
  - spec/winston/constraint_spec.rb
109
134
  - spec/winston/constraints/all_different_spec.rb
135
+ - spec/winston/constraints/not_in_list_spec.rb
110
136
  - spec/winston/csp_spec.rb
111
137
  - spec/winston/domain_spec.rb
138
+ - spec/winston/dsl_spec.rb
139
+ - spec/winston/heuristics_spec.rb
140
+ - spec/winston/mac_spec.rb
141
+ - spec/winston/min_conflicts_spec.rb
112
142
  - spec/winston/variable_spec.rb
@@ -1,40 +0,0 @@
1
- module Winston
2
- class Backtrack
3
- def initialize(csp)
4
- @csp = csp
5
- end
6
-
7
- def search(assignments = {})
8
- return assignments if complete?(assignments)
9
- var = select_unassigned_variable(assignments)
10
- domain_values(var).each do |value|
11
- assigned = assignments.merge(var.name => value)
12
- if valid?(var.name, assigned)
13
- result = search(assigned)
14
- return result if result
15
- end
16
- end
17
- false
18
- end
19
-
20
- private
21
-
22
- attr_reader :csp
23
-
24
- def complete?(assignments)
25
- assignments.size == csp.variables.size
26
- end
27
-
28
- def valid?(changed, assignments)
29
- csp.validate(changed, assignments)
30
- end
31
-
32
- def select_unassigned_variable(assignments)
33
- csp.variables.reject { |k,v| assignments.include?(k) }.each_value.first
34
- end
35
-
36
- def domain_values(var)
37
- csp.variables[var.name].domain.values
38
- end
39
- end
40
- end