Move Generators
Move generators (believe it or not) generate moves in the inner loop of simulated annealing placement.
Mapper2.SA.MoveGenerator — Type.abstract type MoveGeneratorFields
Documentation
API
Implementations
Method List
API
Mapper2.SA.generate_move — Function.generate_move(sa_struct, move_generator, node_idx)Generate a valid for move for the node with index node_idx in sa_struct. If isflat(sa_struct) == true, return CartesianIndex{D} where D = dimension(sa_struct). Otherwise, return Location{D}.
Mapper2.SA.distancelimit — Function.distancelimit(move_generator, sa_struct)Return the maximum move distance of move_generator for sa_struct.
Mapper2.SA.initialize! — Function.initialize!(move_generator, sa_struct, [limit = distancelimit(move_generator, sa_struct)])Initialize the state of move_generator based on sa_struct. Common operations include establishing an initial move distance limit or caching a list of possible moves.
If an initial limit is not supplied, it defaults to the maximum limit of the move generator for the given architecture.
Mapper2.SA.update! — Function.update!(move_generator, sa_struct, limit)Update the move generator to a new move distance limit.
Implementations
Cached Move Generator
Mapper2.SA.CachedMoveGenerator — Type.mutable struct CachedMoveGenerator{T} <: Mapper2.SA.MoveGeneratorFields
moves
Documentation
This move generator precomputes all of the valid moves for each class at all addresses, and references this cached database to generator moves.
Standard classes are used to index into the first level of moves. The inner dictionary is a mapping from a base address to a MoveLUT for that address.
Method List
CachedMoveGenerator(sa_struct)defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Place/SA/MoveGenerators.jl:141.
Mapper2.SA.MoveLUT — Type.mutable struct MoveLUT{T}Fields
targetsVector of destination addresses from the base address. Sorted in increasing order of distance from the base addresses according to the distance metric of the parent
SAStruct.
idxThe index of the last entry in
targetsthat is within the current move distance limit of the base address.
indicesCached
idxfor various move distance limits.
Documentation
Look-up table for moves for a single node class starting at some base address.
The main invariant of this a MoveLUT $L$ is with base address $\alpha$ is
where $\text{distance}$ is the distance between to addresses in the SAStruct and \delta is the current move distance limit.
Thus, to generate a random move within $\delta$ of $\alpha$, we must need to perform the operation
L.targets[rand(1:L.idx)]assuming L.idx has been configured correctly.
To aid in the configuration of L.idx, the field indices is constructed such that for a move limit $\delta$, L.idx = L.indices[δ].
Method List
MoveLUT(targets, idx, indices)defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Place/SA/MoveGenerators.jl:101.
Search Move Generator
SA.SearchMoveGenerator