Stay organized with collections Save and categorize content based on your preferences.

SolverVariable

public class SolverVariable implements Comparable


Represents a given variable used in the linear expression solver.

Summary

Nested types

Type of variables

Constants

static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Public fields

float
int
boolean
boolean
int
int

Public constructors

Base constructor

Public methods

final void
int
String

Accessor for the name

final void
void
void
setFinalValue(LinearSystem system, float value)
void
void
setSynonym(
    LinearSystem system,
    SolverVariable synonymVariable,
    float value
)
void
String

Override the toString() method to display the variable

final void
updateReferencesWithNewDefinition(
    LinearSystem system,
    ArrayRow definition
)

Constants

STRENGTH_BARRIER

public static final int STRENGTH_BARRIER = 6

STRENGTH_CENTERING

public static final int STRENGTH_CENTERING = 7

STRENGTH_EQUALITY

public static final int STRENGTH_EQUALITY = 5

STRENGTH_FIXED

public static final int STRENGTH_FIXED = 8

STRENGTH_HIGH

public static final int STRENGTH_HIGH = 3

STRENGTH_HIGHEST

public static final int STRENGTH_HIGHEST = 4

STRENGTH_LOW

public static final int STRENGTH_LOW = 1

STRENGTH_MEDIUM

public static final int STRENGTH_MEDIUM = 2

STRENGTH_NONE

public static final int STRENGTH_NONE = 0

Public fields

computedValue

public float computedValue

id

public int id

inGoal

public boolean inGoal

isFinalValue

public boolean isFinalValue

strength

public int strength

usageInRowCount

public int usageInRowCount

Public constructors

SolverVariable

public SolverVariable(String name, SolverVariable.Type type)

Base constructor

Parameters
String name

the variable name

SolverVariable.Type type

the type of the variable

SolverVariable

public SolverVariable(SolverVariable.Type type, String prefix)

Public methods

addToRow

public final void addToRow(ArrayRow row)

compareTo

public int compareTo(SolverVariable v)

getName

public String getName()

Accessor for the name

Returns
String

the name of the variable

removeFromRow

public final void removeFromRow(ArrayRow row)

reset

public void reset()

setFinalValue

public void setFinalValue(LinearSystem system, float value)

setName

public void setName(String name)

setSynonym

public void setSynonym(
    LinearSystem system,
    SolverVariable synonymVariable,
    float value
)

setType

public void setType(SolverVariable.Type type, String prefix)

toString

public String toString()

Override the toString() method to display the variable

updateReferencesWithNewDefinition

public final void updateReferencesWithNewDefinition(
    LinearSystem system,
    ArrayRow definition
)