/** * Instantiate the recommender graph. * @param graph The recommender graph. * @return The instantiated graph. */ protected DAGNode<Component, Dependency> instantiateGraph(DAGNode<Component, Dependency> graph) { RecommenderInstantiator inst = RecommenderInstantiator.create(graph); graph = inst.instantiate(); return graph; }
public static RecommenderInstantiator create(DAGNode<Component,Dependency> g) { return new RecommenderInstantiator(g); }
/** * Simulate instantiating a graph. * @return The simulated graph. */ public DAGNode<Component,Dependency> simulate() throws RecommenderBuildException { try { return replaceShareableNodes(NodeProcessors.simulateInstantiation()); } catch (InjectionException e) { throw new RecommenderBuildException("Simulated instantiation failed", e); } }
logger.debug("graph has {} nodes", graph.getReachableNodes().size()); logger.debug("simulating instantiation"); RecommenderInstantiator instantiator = RecommenderInstantiator.create(graph); DAGNode<Component, Dependency> unshared = instantiator.simulate(); logger.debug("unshared graph has {} nodes", unshared.getReachableNodes().size()); try (BufferedWriter bw = new BufferedWriter(graphvizFile);
@Deprecated public static RecommenderInstantiator forConfig(LenskitConfiguration config) throws RecommenderConfigurationException { return create(config.buildGraph()); }
logger.debug("graph has {} nodes", graph.getReachableNodes().size()); logger.debug("simulating instantiation"); RecommenderInstantiator instantiator = RecommenderInstantiator.create(graph); DAGNode<Component, Dependency> unshared = instantiator.simulate(); logger.debug("unshared graph has {} nodes", unshared.getReachableNodes().size()); try (Writer writer = new FileWriter(graphvizFile);
@Deprecated public static RecommenderInstantiator forConfig(LenskitConfiguration config) throws RecommenderConfigurationException { return create(config.buildGraph()); }
/** * Instantiate the recommender graph. * @param graph The recommender graph. * @return The instantiated graph. */ protected DAGNode<Component, Dependency> instantiateGraph(DAGNode<Component, Dependency> graph) { RecommenderInstantiator inst = RecommenderInstantiator.create(graph); graph = inst.instantiate(); return graph; }
/** * Instantiate the recommender graph. This requires the graph to have been resolved with a real * DAO instance, not just a class, if anything references the DAO. Use {@link * LenskitConfiguration#buildGraph()} to get such a graph. The result of instantiating a graph * is that all shareable nodes will be instantiated. * * @return A new recommender graph with all shareable nodes pre-instantiated. * @throws RecommenderBuildException If there is an error instantiating the graph. */ public DAGNode<Component,Dependency> instantiate() throws RecommenderBuildException { try (LifecycleManager lm = new LifecycleManager()) { NodeInstantiator instantiator = NodeInstantiator.create(lm); // TODO Verify that no sharable components are lifecycle-managed return replaceShareableNodes(NodeProcessors.instantiate(instantiator)); } catch (InjectionException e) { throw new RecommenderBuildException("Recommender instantiation failed", e); } }
public static RecommenderInstantiator create(DAGNode<Component,Dependency> g) { return new RecommenderInstantiator(g); }
if (cache == null) { logger.debug("Building directly without a cache"); RecommenderInstantiator ri = RecommenderInstantiator.create(cfgGraph); graph = ri.instantiate(); } else { logger.debug("Instantiating graph with a cache");
/** * Simulate instantiating a graph. * @return The simulated graph. */ public DAGNode<Component,Dependency> simulate() throws RecommenderBuildException { try { return replaceShareableNodes(NodeProcessors.simulateInstantiation()); } catch (InjectionException e) { throw new RecommenderBuildException("Simulated instantiation failed", e); } }
/** * Instantiate the recommender graph. This requires the graph to have been resolved with a real * DAO instance, not just a class, if anything references the DAO. Use {@link * LenskitConfiguration#buildGraph()} to get such a graph. The result of instantiating a graph * is that all shareable nodes will be instantiated. * * @return A new recommender graph with all shareable nodes pre-instantiated. * @throws RecommenderBuildException If there is an error instantiating the graph. */ public DAGNode<Component,Dependency> instantiate() throws RecommenderBuildException { try (LifecycleManager lm = new LifecycleManager()) { NodeInstantiator instantiator = NodeInstantiator.create(lm); // TODO Verify that no sharable components are lifecycle-managed return replaceShareableNodes(NodeProcessors.instantiate(instantiator)); } catch (InjectionException e) { throw new RecommenderBuildException("Recommender instantiation failed", e); } }