public class MultiAlgorithmDSL extends LenskitConfigDSL
DSL delegate for configuring multiple LensKit algorithms with names and attributes. It adds two new capabilities:
getAttributes()
property exposes the algorithm instance attributes for manipulation.algorithm(String, Closure)
method allows for algorithm
blocks so more than one algorithm can be defined in a script.If algorithm
blocks are used in a script, then only those blocks’ algorithms are generated; a top-level algorithm is not generated. algorithm
blocks also nest, and only those blocks that have no child algorithm
blocks actually produce new algorithms.
Constructor and Description |
---|
MultiAlgorithmDSL(ConfigurationLoader loader,
AlgorithmInstanceBuilder aib) |
Modifier and Type | Method and Description |
---|---|
void |
algorithm(groovy.lang.Closure<?> block) |
void |
algorithm(java.lang.String name,
groovy.lang.Closure<?> block)
Create a new algorithm in this file.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes() |
java.util.List<AlgorithmInstance> |
getInstances() |
getBaseURI, getConfig, getConfigLoader, include, root, setBaseURI
addComponent, at, at, at, at, at, at, bind, bind, bindAny, domain, getContext, include, include, include, matching, matching, prefDomain, set, within, within, within, within, within, within
addComponent, in, in, in, wrapContext
public MultiAlgorithmDSL(ConfigurationLoader loader, AlgorithmInstanceBuilder aib)
public java.util.List<AlgorithmInstance> getInstances()
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public void algorithm(groovy.lang.Closure<?> block)
public void algorithm(java.lang.String name, groovy.lang.Closure<?> block)
Create a new algorithm in this file.
name
- The algorithm name.block
- The configuration block.