Methods
_compareIndexesOf(queue, c1, c2) → {number}
Comparison of position in queue
Parameters:
Name | Type | Description |
---|---|---|
queue |
array | array with configurations |
c1 |
class | configuration to compare 1 |
c2 |
class | configuration to compare 2 |
- Source:
Returns:
compared indexes of configurations in queue 1: c1 < c2, 2: c2 > c1, 0: not found
- Type
- number
_containsSearch(set, configuration) → {boolean}
Tabu state check
Parameters:
Name | Type | Description |
---|---|---|
set |
object | indexed tabu states |
configuration |
class | instance of a problem configuration |
- Source:
Returns:
contains
- Type
- boolean
_generateNeighborhood(size, neighborsToCheckRatio) → {array}
Returns neighborhood to check
Parameters:
Name | Type | Description |
---|---|---|
size |
number | size of the neighborhood |
neighborsToCheckRatio |
number | > 0 && <= 1 how big part of neighborhood to check |
- Source:
Returns:
array with selected neighbors indexes to check
- Type
- array
_getCost(size, neighborsToCheckRatio) → {array}
Wrapper for cost function, because Tabu inner cycle starts without a selected state
Parameters:
Name | Type | Description |
---|---|---|
size |
number | size of the neighborhood |
neighborsToCheckRatio |
number | > 0 && <= 1 how big part of neighborhood to check |
- Source:
Returns:
array with selected neighbors indexes to check
- Type
- array
_process(iterationLimit, neighborsToCheckRatio, tabuSize, tabuSizeShort, randomStart) → {class}
Method contains Tabu Search algorithm
Parameters:
Name | Type | Description |
---|---|---|
iterationLimit |
number | number of iterations |
neighborsToCheckRatio |
number | how many of all neighbour states to check |
tabuSize |
number | length of tabu states queue |
tabuSizeShort |
number | length of tabu changes queue |
randomStart |
boolean | starting state is default (false) or random (true) |
- Source:
Returns:
final configuration
- Type
- class
solve(problem, params) → {Result}
Main function method, solves the problem using simulated annealing
Parameters:
Name | Type | Description |
---|---|---|
problem |
Problem | problem instance |
params |
object | problem parameters |
- Source:
Returns:
Result class containing data of the run
- Type
- Result