feldtruby 0.4.3 → 0.4.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f017a746cfb0c942893d7207ddcd0ec3d3a2a252
|
4
|
+
data.tar.gz: 475222949c01be1ae9dbb5678b4f2da00bf5a877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b85a1f419930ec29d072227bfa3423b3088f2befc4755d60df2cf8f870407d35cb84b2684074917c38aa3904e697476bc6ea9d5ecb633e0692e9a2c274fb6c02
|
7
|
+
data.tar.gz: f825a6ee4384822a133f39df4f8c1867f42e611e2cdb307bcf2eaf3771860435f2ed1cd7440210b0841c2040f83e4affd1744023350154e40095dd272679b6d1
|
data/lib/feldtruby/logger.rb
CHANGED
@@ -9,7 +9,7 @@ module FeldtRuby
|
|
9
9
|
class Logger
|
10
10
|
DefaultParams = {
|
11
11
|
:verbose => false,
|
12
|
-
:printFrequency => 0.
|
12
|
+
:printFrequency => 0.4 # Minimum seconds between consecutive messages printed for the same event type
|
13
13
|
}
|
14
14
|
|
15
15
|
UnixEpoch = Time.at(0)
|
@@ -67,7 +67,7 @@ class DEOptimizerBase < EvolutionaryOptimizer
|
|
67
67
|
"Trial Quality" => @objective.quality_of(trial),
|
68
68
|
"Target" => target,
|
69
69
|
"Target Quality" => @objective.quality_of(target)
|
70
|
-
}, "DE (step #{@num_optimization_steps}): Trial vector was better than target vector"
|
70
|
+
}, "DE (step #{@num_optimization_steps}): Trial vector was better than target vector", true
|
71
71
|
update_candidate_in_population(target_index, trial)
|
72
72
|
feedback_on_trial_vs_target(trial, target, true)
|
73
73
|
else
|
@@ -262,7 +262,7 @@ class Objective
|
|
262
262
|
max = @global_max_values_per_goal[index]
|
263
263
|
|
264
264
|
return unless qValue
|
265
|
-
|
265
|
+
|
266
266
|
if qValue < min
|
267
267
|
|
268
268
|
@global_min_values_per_goal[index] = qValue
|
@@ -462,7 +462,7 @@ class QualityValue
|
|
462
462
|
end
|
463
463
|
|
464
464
|
def to_s
|
465
|
-
subqs = sub_qualities.map {|f| f.to_significant_digits(3)}
|
465
|
+
subqs = sub_qualities.map {|f| f ? f.to_significant_digits(3) : nil}
|
466
466
|
# Note! We ask for the value first which guarantees that we then have a version number.
|
467
467
|
qstr = "#{value.to_significant_digits(4)}"
|
468
468
|
"#{qstr} (SubQs = #{subqs.inspect}, ver. #{@version})"
|
data/lib/feldtruby/version.rb
CHANGED
@@ -492,9 +492,11 @@ describe "Can handle objectives that return nil" do
|
|
492
492
|
q1 = o.quality_of([1])
|
493
493
|
q1.sub_qualities.must_equal [1]
|
494
494
|
q1.value.must_equal 0.0 # Perfect score
|
495
|
+
q1.to_s.must_equal "0.0 (SubQs = [1.0], ver. 2)"
|
495
496
|
|
496
497
|
q2 = o.quality_of([])
|
497
498
|
q2.sub_qualities.must_equal [nil]
|
498
499
|
q2.value.must_equal 1000.0 # Max penalty
|
500
|
+
q2.to_s.must_equal "1000.0 (SubQs = [nil], ver. 2)"
|
499
501
|
end
|
500
502
|
end
|