Class CompoundGenerator

All Implemented Interfaces:
Iterable<IPosition>, IModelProvider<CompoundModel>, IPointGenerator<CompoundModel>, PySerializable

public class CompoundGenerator extends AbstractMultiGenerator<CompoundModel>
CompoundGenerators (analogously to their Python equivalents) handle not only compounding scans within one another, but additionally mutators, regions of interests, the duration of a point within a scan. Compounding a scan means repeating every point of a scan for each point of another: gen1.createPoints() = [("x": 1), ("x" :3), ("x": 5)] -> a scan visiting points in a scannable axis "x", starting at 0, stopping at 5 and stepping 2. gen2.createPoints() = [("y": 0.6), ("y": 0.9),("y": 1.2)} -> and a scan visiting points in axis "y" from 0.6 to 1.2 in steps of 0.3 cgen = new CompoundGenerator(gen1, gen2) cgen.createPoints() = [("x" : 1, "y": 0.6), ("x": 1, "y":0.9), ("x":1, "y":1.2), ("x":2, "y": 0.3), ...] Compounding may either be performed on PPointGenerators or GDA ScanPathModels through constructing a CompoundModel Compounding may be performed an arbitrary number of levels deep, although no two models or generators may share axes
  • Constructor Details

    • CompoundGenerator

      public CompoundGenerator(List<IPointGenerator<? extends IScanPointGeneratorModel>> generators, IPointGeneratorService pgs) throws GeneratorException
      Parameters:
      generators - an array of IPointGenerator[s], which are compounded together to produce a new PPointGenerator represented by this generator's CompoundModel. The rightmost/last generator is the "fastest" to change, with every point that it produces being repeated for every point of its leftwards neighbour, itself repeated for every point of its neighbour until the outermost generator.
      Throws:
      GeneratorException - when validation throws a ModelValidationException for the CompoundModel constructed from the IPointGenerators- e.g. when generators contains nulls, when more than one generator acts on an axis, or when something causes the call to the Python CompoundGenerator to fail. If any of the generators passed to this constructor are NoModelGenerator, the CompoundModel will be an incomplete representation of the scan, and any GeneratorException thrown may have less complete information.
    • CompoundGenerator

      public CompoundGenerator(CompoundModel model, IPointGeneratorService pgs)
  • Method Details