class Solve::Problem
Simple struct class that contains a graph and demands (in Array form)
Can be serialized via Solver::Serializer
to create a json representation of a dependency solving problem.
Public Class Methods
from_solver(solver)
click to toggle source
Create a Problem
from a given Solver
.
@param [Solve::GecodeSolver,Solve::RubySolver] dependency solver @return [Problem]
# File lib/solve/solver/serializer.rb, line 18 def self.from_solver(solver) demands_data = solver.demands.map do |demand| [ demand.name, demand.constraint.to_s ] end new(solver.graph, demands_data) end