Problem

be.cetic.ddolibscala.nolayer.modeling.Problem
trait Problem[T] extends Problem[T]

Problem defines the state space, the transitions between states induced by labels, and the objective values associated with those transitions. Implementations provide the essential operations required by solvers, without an a priori fixed number of variables.

Type parameters

T

the type representing a state in the problem

Attributes

Graph
Supertypes
trait Problem[T]
class Object
trait Matchable
class Any
Known subtypes
class MispProblem

Members list

Value members

Abstract methods

def domainLabels(state: T): Iterable[Int]

Returns the domain of possible labels/actions from a given state.

Returns the domain of possible labels/actions from a given state.

Value parameters

state

the current state

Attributes

Returns

all feasible labels for the given state

def evaluate(solution: Seq[Int]): Double

Given a solution (a sequence of applied labels), returns its value and checks if the solution respects the problem's constraints.

Given a solution (a sequence of applied labels), returns its value and checks if the solution respects the problem's constraints.

Value parameters

solution

A solution of the problem (sequence of labels).

Attributes

Returns

The value of the input solution

override def initialState(): T

Returns the initial state of the problem.

Returns the initial state of the problem.

Attributes

Returns

the state representing the starting point of the optimization

Definition Classes
Problem
override def initialValue(): Double

Returns the initial objective value associated with the initial state.

Returns the initial objective value associated with the initial state.

Attributes

Returns

the starting value of the objective function

Definition Classes
Problem
override def isTarget(state: T): Boolean

Checks whether the given state is a target (sink) state.

Checks whether the given state is a target (sink) state.

Value parameters

state

the current state

Attributes

Returns

true if the state is a target state, false otherwise

Definition Classes
Problem
override def transition(state: T, label: Int): T

Applies a label/action to a state, computing the next state according to the problem's transition function.

Applies a label/action to a state, computing the next state according to the problem's transition function.

Value parameters

label

the label to apply

state

the state from which the transition originates

Attributes

Returns

the resulting state after applying the label

Definition Classes
Problem
override def transitionCost(state: T, label: Int): Double

Computes the change in objective value resulting from applying a label to a given state.

Computes the change in objective value resulting from applying a label to a given state.

Value parameters

label

the label to apply

state

the state from which the transition originates

Attributes

Returns

the incremental objective cost/value associated with this label

Definition Classes
Problem

Concrete methods

final override def domain(state: T): Iterator[Integer]

Used by the solver. Converts the output of domainLabels from Scala to Java.

Used by the solver. Converts the output of domainLabels from Scala to Java.

Attributes

Definition Classes
Problem
final override def evaluate(solution: List[Integer]): Double

Used by the solver. Converts the input of evaluate from Java to Scala.

Used by the solver. Converts the input of evaluate from Java to Scala.

Attributes

Definition Classes
Problem
def optimal: Option[Double]

Returns the known optimal value of the problem, if available.

Returns the known optimal value of the problem, if available.

Attributes

Returns

an Option containing the known optimal value, or None if unknown

final override def optimalValue(): Optional[Double]

Used by the solver. Converts the output of optimal from Scala to Java.

Used by the solver. Converts the output of optimal from Scala to Java.

Attributes

Definition Classes
Problem