Class: Solve::Tracers::HumanReadable
Constant Summary
AbstractTracer::TRACER_METHODS
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HumanReadable.
11
12
13
|
# File 'lib/solve/tracers/human_readable.rb', line 11
def initialize(ui)
@ui = ui
end
|
Instance Attribute Details
#ui ⇒ Object
Returns the value of attribute ui.
6
7
8
|
# File 'lib/solve/tracers/human_readable.rb', line 6
def ui
@ui
end
|
Instance Method Details
#add_constraint(dependency, source) ⇒ Object
46
47
48
|
# File 'lib/solve/tracers/human_readable.rb', line 46
def add_constraint(dependency, source)
say("Adding constraint #{dependency.name} #{dependency.constraint} from #{source.to_s}")
end
|
#backtrack(unbound_variable) ⇒ Object
33
34
35
|
# File 'lib/solve/tracers/human_readable.rb', line 33
def backtrack(unbound_variable)
say("Could not find an acceptable value for #{unbound_variable.artifact.to_s}")
end
|
#cannot_backtrack ⇒ Object
37
38
39
|
# File 'lib/solve/tracers/human_readable.rb', line 37
def cannot_backtrack
say("Cannot backtrack any further")
end
|
#possible_values(possible_values) ⇒ Object
25
26
27
|
# File 'lib/solve/tracers/human_readable.rb', line 25
def possible_values(possible_values)
say("Possible values are #{possible_values.map(&:to_s).join("\n\t")}")
end
|
#remove_constraint(constraint) ⇒ Object
62
63
64
|
# File 'lib/solve/tracers/human_readable.rb', line 62
def remove_constraint(constraint)
say("Removed constraint #{constraint.name} #{constraint.constraint}")
end
|
#remove_variable(variable) ⇒ Object
58
59
60
|
# File 'lib/solve/tracers/human_readable.rb', line 58
def remove_variable(variable)
say("Removed variable #{variable.artifact.to_s}")
end
|
#reset_domain(variable) ⇒ Object
50
51
52
|
# File 'lib/solve/tracers/human_readable.rb', line 50
def reset_domain(variable)
say("Resetting possible values for #{variable.artifact.to_s}")
end
|
#searching_for(unbound_variable, constraints, possible_values) ⇒ Object
19
20
21
22
23
|
# File 'lib/solve/tracers/human_readable.rb', line 19
def searching_for(unbound_variable, constraints, possible_values)
say("Searching for a value for #{unbound_variable.artifact}")
say("Constraints are #{constraints.join("\n\t")}")
possible_values(possible_values)
end
|
#solution(solution) ⇒ Object
41
42
43
44
|
# File 'lib/solve/tracers/human_readable.rb', line 41
def solution(solution)
say("Found Solution")
say(solution)
end
|
#start ⇒ Object
15
16
17
|
# File 'lib/solve/tracers/human_readable.rb', line 15
def start
say("Attempting to find a solution")
end
|
#trying(artifact) ⇒ Object
29
30
31
|
# File 'lib/solve/tracers/human_readable.rb', line 29
def trying(artifact)
say("Attempting to use #{artifact.to_s}")
end
|
#unbind(variable) ⇒ Object
54
55
56
|
# File 'lib/solve/tracers/human_readable.rb', line 54
def unbind(variable)
say("Unbinding #{variable.artifact.to_s}")
end
|