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(String name,
groovy.lang.Closure<?> block)
Create a new algorithm in this file.
|
Map<String,Object> |
getAttributes() |
List<AlgorithmInstance> |
getInstances() |
getBaseURI, getConfig, getConfigLoader, include, root, setBaseURIaddComponent, at, at, at, at, at, at, bind, bind, bindAny, domain, getContext, include, include, include, matching, matching, prefDomain, set, within, within, within, within, within, withinaddComponent, in, in, in, wrapContextpublic MultiAlgorithmDSL(ConfigurationLoader loader, AlgorithmInstanceBuilder aib)
public List<AlgorithmInstance> getInstances()
public void algorithm(groovy.lang.Closure<?> block)
public void algorithm(String name, groovy.lang.Closure<?> block)
Create a new algorithm in this file.
name - The algorithm name.block - The configuration block.