Move Generators

Move Generators

Move generators (believe it or not) generate moves in the inner loop of simulated annealing placement.

abstract type MoveGenerator

Fields

Documentation

API

Implementations

Method List

source

API

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}.

source
distancelimit(move_generator, sa_struct)

Return the maximum move distance of move_generator for sa_struct.

source
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.

source
Mapper2.SA.update!Function.
update!(move_generator, sa_struct, limit)

Update the move generator to a new move distance limit.

source

Implementations

Cached Move Generator

mutable struct CachedMoveGenerator{T} <: Mapper2.SA.MoveGenerator

Fields

  • 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.

source
mutable struct MoveLUT{T}

Fields

  • targets

    Vector 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.

  • idx

    The index of the last entry in targets that is within the current move distance limit of the base address.

  • indices

    Cached idx for 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

\[\text{distance}\left( L_\text{targets}[i] - \alpha \right) \leq \delta \, \forall i \in 1 \ldots L_\text{idx}\]

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.

source

Search Move Generator

SA.SearchMoveGenerator