hermes
Interface Optimizer<A extends HObject,B extends HObject,GroupA extends GenericGroup<A,?>,GroupB extends GenericGroup<B,?>>

All Known Implementing Classes:
SelfInteractionOptimizer

public interface Optimizer<A extends HObject,B extends HObject,GroupA extends GenericGroup<A,?>,GroupB extends GenericGroup<B,?>>

Determines which beings are compared and potentially interacted by Interactor. Unoptimized interactions check all members of A against all the members of B (order n^2). Optimizers allow for the creation of data structures which will speed interactions.

Group B is given as argument to constructor and organized according to optimizer type. Detect checks body A against the structure formed from Group B.

Sample advanced optimizers include quadtree.


Method Summary
 void detect(GroupA group1, GroupB group2, InteractionHandler<A,B> handler)
          This should detect all possible interactions between the members of groups A and B, using handler.
 

Method Detail

detect

void detect(GroupA group1,
            GroupB group2,
            InteractionHandler<A,B> handler)
This should detect all possible interactions between the members of groups A and B, using handler.

Parameters:
group1 - a group of beings
group2 - a group of beings
handler - interaction handler that will detect and handle interactions