ArrayRow
public class ArrayRow
GoalRow |
|
PriorityGoalRow |
Implements a row containing goals taking in account priorities. |
Summary
Nested types |
|---|
public interface ArrayRow.ArrayRowVariables |
Public fields |
|
|---|---|
ArrayRow.ArrayRowVariables |
Public methods |
|
|---|---|
void |
addError(SolverVariable error) |
ArrayRow |
addError(LinearSystem system, int strength) |
void |
clear() |
ArrayRow |
createRowDimensionRatio(Create a constraint to express |
ArrayRow |
createRowEqualDimension( |
ArrayRow |
createRowEqualMatchDimensions( |
ArrayRow |
createRowEquals(SolverVariable variable, int value) |
ArrayRow |
createRowEquals( |
ArrayRow |
createRowGreaterThan(SolverVariable a, int b, SolverVariable slack) |
ArrayRow |
createRowGreaterThan( |
ArrayRow |
createRowLowerThan( |
ArrayRow |
createRowWithAngle(Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle |
SolverVariable |
getKey() |
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 |
isEmpty() |
SolverVariable |
pickPivot(SolverVariable exclude) |
void |
reset() |
String |
toString() |
void |
updateFromFinalVariable( |
void |
updateFromRow( |
void |
updateFromSynonymVariable( |
void |
updateFromSystem(LinearSystem system) |
Public fields
Public constructors
Public methods
createRowDimensionRatio
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
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
public ArrayRow createRowEqualMatchDimensions(
float currentWeight,
float totalWeights,
float nextWeight,
SolverVariable variableStartA,
SolverVariable variableEndA,
SolverVariable variableStartB,
SolverVariable variableEndB
)
createRowEquals
public ArrayRow createRowEquals(
SolverVariable variableA,
SolverVariable variableB,
int margin
)
createRowGreaterThan
public ArrayRow createRowGreaterThan(SolverVariable a, int b, SolverVariable slack)
createRowGreaterThan
public ArrayRow createRowGreaterThan(
SolverVariable variableA,
SolverVariable variableB,
SolverVariable slack,
int margin
)
createRowLowerThan
public ArrayRow createRowLowerThan(
SolverVariable variableA,
SolverVariable variableB,
SolverVariable slack,
int margin
)
createRowWithAngle
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
getPivotCandidate
public SolverVariable getPivotCandidate(LinearSystem system, boolean[] avoid)
initFromRow
public void initFromRow(LinearSystem.Row row)
Used to initiate a goal from a given row (to see if we can remove an extra var)
updateFromFinalVariable
public void updateFromFinalVariable(
LinearSystem system,
SolverVariable variable,
boolean removeFromDefinition
)
updateFromRow
public void updateFromRow(
LinearSystem system,
ArrayRow definition,
boolean removeFromDefinition
)
updateFromSynonymVariable
public void updateFromSynonymVariable(
LinearSystem system,
SolverVariable variable,
boolean removeFromDefinition
)