annealer 0.2 → 0.3

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.
Files changed (3) hide show
  1. checksums.yaml +5 -13
  2. data/lib/annealer.rb +6 -3
  3. metadata +7 -7
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWI5ZWY3MGIyOWM3MzExNTAzZTE5OGU1ODQzZjI2YTc2NmIyMjNiMQ==
5
- data.tar.gz: !binary |-
6
- YjYzZTFhOTY4NjZhNWYxM2JhNDg1YmY3NTNiOGI2MjEwMzVkOTlhYg==
2
+ SHA1:
3
+ metadata.gz: b65759d8bb675173b0c67a382a95982fce53505f
4
+ data.tar.gz: c1eca86a25bfde107e0b8ecde5b4804fccd88380
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjM4NDExNTI1MGU1MmRiNmVlMDQ0MjA3MThlMzIzM2QxZmYxOGI4OGRhOWFm
10
- ZmQxMjc2MjAyYjRkMzY3Mjk4NDZjNDkxNmNjYTBmOWE1ZDlhOTgxZTc0Y2Ri
11
- ZTc1MDc4NmVkYjgxOWY3ZmFhYTliMzZhZjE1ZmExYjAzMzM0Zjc=
12
- data.tar.gz: !binary |-
13
- MTcyNWIzZmM4YzRlNGMzMmNhZmQxYWE3MGY2NzkwZWNmZmVhOWIxMjY3Zjk2
14
- MGFlOWQ4NjU0NTgyMDQ0ZWU5ZmFhNDAzZGY4OTRlYmYwNTUxMWU2MGFjZWFm
15
- MmQ0NTYxMzMzNzU4NTRiOGNmODY0OTVhNGU2ZTRjM2UzMjQ1ZDI=
6
+ metadata.gz: 93bb4ba526714899afa7fac51e899741a9d7290c8f7b04779600fd5e066f01272451489fa8d5d3b6a1900694cb61a204c15fe670776b51826e0519ea05f9934f
7
+ data.tar.gz: aafc6b05cdf74bc76d79b0193779274b5e7a0746cf7047b5d8d61d5dbe362bf90573bf393f7b66c58254fc2849470c353dbc29616f0d9daf8dfc264cb59c41a6
@@ -46,13 +46,16 @@ class Annealer
46
46
  # too many hops between any two states.
47
47
  #
48
48
  def anneal(start_state)
49
- best_state = nil
50
- best_energy = 1 / 0.0
51
49
  energy = start_state.energy
50
+ best_state = start_state
51
+ best_energy = energy
52
+
53
+ logger.info "Starting state:"
54
+ logger.info best_state.inspect
52
55
 
53
56
  @repetition_count.times do |rep|
54
57
  logger.info "Repetition #{rep}..." if @repetition_count > 1
55
- state = best_state || start_state
58
+ state = best_state
56
59
 
57
60
  iter_count = 0
58
61
  while !@stop_condition.call(iter_count, best_energy)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annealer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Cantrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-12 00:00:00.000000000 Z
11
+ date: 2017-03-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: cantrell@pobox.com
@@ -16,9 +16,9 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/annealer.rb
20
- - README.md
21
19
  - LICENSE
20
+ - README.md
21
+ - lib/annealer.rb
22
22
  homepage: http://github.com/pcantrell/annealer
23
23
  licenses:
24
24
  - MIT
@@ -29,17 +29,17 @@ require_paths:
29
29
  - lib
30
30
  required_ruby_version: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ! '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 2.1.10
42
+ rubygems_version: 2.5.2
43
43
  signing_key:
44
44
  specification_version: 4
45
45
  summary: Simulated annealing framework