public class ArrayRow

Known direct subclasses
GoalRow
PriorityGoalRow

Implements a row containing goals taking in account priorities.


Summary

Nested types

Public constructors

ArrayRow(Cache cache)

Public methods

void
ArrayRow
addError(LinearSystem system, int strength)
void
ArrayRow
createRowDimensionRatio(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable variableC,
    SolverVariable variableD,
    float ratio
)

Create a constraint to express A = B + (C - D) * ratio We use this for ratio, where for example Right = Left + (Bottom - Top) * percent

ArrayRow
createRowEqualDimension(
    float currentWeight,
    float totalWeights,
    float nextWeight,
    SolverVariable variableStartA,
    int marginStartA,
    SolverVariable variableEndA,
    int marginEndA,
    SolverVariable variableStartB,
    int marginStartB,
    SolverVariable variableEndB,
    int marginEndB
)
ArrayRow
createRowEqualMatchDimensions(
    float currentWeight,
    float totalWeights,
    float nextWeight,
    SolverVariable variableStartA,
    SolverVariable variableEndA,
    SolverVariable variableStartB,
    SolverVariable variableEndB
)
ArrayRow
createRowEquals(SolverVariable variable, int value)
ArrayRow
createRowEquals(
    SolverVariable variableA,
    SolverVariable variableB,
    int margin
)
ArrayRow
ArrayRow
createRowGreaterThan(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable slack,
    int margin
)
ArrayRow
createRowLowerThan(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable slack,
    int margin
)
ArrayRow
createRowWithAngle(
    SolverVariable at,
    SolverVariable ab,
    SolverVariable bt,
    SolverVariable bb,
    float angleComponent
)

Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle

SolverVariable
SolverVariable
getPivotCandidate(LinearSystem system, boolean[] avoid)
void

Used to initiate a goal from a given row (to see if we can remove an extra var)

boolean
SolverVariable
void
String
void
updateFromFinalVariable(
    LinearSystem system,
    SolverVariable variable,
    boolean removeFromDefinition
)
void
updateFromRow(
    LinearSystem system,
    ArrayRow definition,
    boolean removeFromDefinition
)
void
updateFromSynonymVariable(
    LinearSystem system,
    SolverVariable variable,
    boolean removeFromDefinition
)
void

Public fields

variables

Added in 1.1.0-alpha13
public ArrayRow.ArrayRowVariables variables

Public constructors

ArrayRow

Added in 1.1.0-alpha13
public ArrayRow()

ArrayRow

Added in 1.1.0-alpha13
public ArrayRow(Cache cache)

Public methods

addError

Added in 1.1.0-alpha13
public void addError(SolverVariable error)

addError

Added in 1.1.0-alpha13
public ArrayRow addError(LinearSystem system, int strength)

clear

Added in 1.1.0-alpha13
public void clear()

createRowDimensionRatio

Added in 1.1.0-alpha13
public ArrayRow createRowDimensionRatio(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable variableC,
    SolverVariable variableD,
    float ratio
)

Create a constraint to express A = B + (C - D) * ratio We use this for ratio, where for example Right = Left + (Bottom - Top) * percent

Parameters
SolverVariable variableA

variable A

SolverVariable variableB

variable B

SolverVariable variableC

variable C

SolverVariable variableD

variable D

float ratio

ratio between AB and CD

Returns
ArrayRow

the row

createRowEqualDimension

Added in 1.1.0-alpha13
public ArrayRow createRowEqualDimension(
    float currentWeight,
    float totalWeights,
    float nextWeight,
    SolverVariable variableStartA,
    int marginStartA,
    SolverVariable variableEndA,
    int marginEndA,
    SolverVariable variableStartB,
    int marginStartB,
    SolverVariable variableEndB,
    int marginEndB
)

createRowEqualMatchDimensions

Added in 1.1.0-alpha13
public ArrayRow createRowEqualMatchDimensions(
    float currentWeight,
    float totalWeights,
    float nextWeight,
    SolverVariable variableStartA,
    SolverVariable variableEndA,
    SolverVariable variableStartB,
    SolverVariable variableEndB
)

createRowEquals

Added in 1.1.0-alpha13
public ArrayRow createRowEquals(SolverVariable variable, int value)

createRowEquals

Added in 1.1.0-alpha13
public ArrayRow createRowEquals(
    SolverVariable variableA,
    SolverVariable variableB,
    int margin
)

createRowGreaterThan

Added in 1.1.0-alpha13
public ArrayRow createRowGreaterThan(SolverVariable a, int b, SolverVariable slack)

createRowGreaterThan

Added in 1.1.0-alpha13
public ArrayRow createRowGreaterThan(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable slack,
    int margin
)

createRowLowerThan

Added in 1.1.0-alpha13
public ArrayRow createRowLowerThan(
    SolverVariable variableA,
    SolverVariable variableB,
    SolverVariable slack,
    int margin
)

createRowWithAngle

Added in 1.1.0-alpha13
public ArrayRow createRowWithAngle(
    SolverVariable at,
    SolverVariable ab,
    SolverVariable bt,
    SolverVariable bb,
    float angleComponent
)

Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle

getKey

Added in 1.1.0-alpha13
public SolverVariable getKey()

getPivotCandidate

Added in 1.1.0-alpha13
public SolverVariable getPivotCandidate(LinearSystem system, boolean[] avoid)

initFromRow

Added in 1.1.0-alpha13
public void initFromRow(LinearSystem.Row row)

Used to initiate a goal from a given row (to see if we can remove an extra var)

isEmpty

Added in 1.1.0-alpha13
public boolean isEmpty()

pickPivot

Added in 1.1.0-alpha13
public SolverVariable pickPivot(SolverVariable exclude)

reset

Added in 1.1.0-alpha13
public void reset()

toString

public String toString()

updateFromFinalVariable

Added in 1.1.0-alpha13
public void updateFromFinalVariable(
    LinearSystem system,
    SolverVariable variable,
    boolean removeFromDefinition
)

updateFromRow

Added in 1.1.0-alpha13
public void updateFromRow(
    LinearSystem system,
    ArrayRow definition,
    boolean removeFromDefinition
)

updateFromSynonymVariable

Added in 1.1.0-alpha13
public void updateFromSynonymVariable(
    LinearSystem system,
    SolverVariable variable,
    boolean removeFromDefinition
)

updateFromSystem

Added in 1.1.0-alpha13
public void updateFromSystem(LinearSystem system)