@Override public SolutionStore getSolutionStore() { return globalContext.getSolutionStore(); }
/** * Returns all of the found {@link Solution}s, trajectories. Call it after * {@link DesignSpaceExplorer#startExploration()}. Calling this while the process is running returns the solutions * that have been found <b>so far</b>. The returned {@link Solution} objects may change internal state after they * have been returned, if a shorter trajectory has been found to the referred state. * * @return The found solutions. */ public Collection<Solution> getSolutions() { return globalContext.getSolutionStore().getSolutions(); }
/** * Serializes all the found solutions by transforming the given initial model. * </p>Files will be named using the {@link ISolutionNameProvider}. * @param model The initial model. */ public void saveModels(Notifier model, ISolutionNameProvider solutionNameProvider) { globalContext.getSolutionStore().saveModels(model, solutionNameProvider); } }
@Override public void newSolution() { globalContext.getSolutionStore().newSolution(this); }
/** * Serializes all the found solutions by transforming the given initial model. * </p>Files will be named <code>[fileNamePrefix][id].[extension]</code>. * @param model The initial model. * @param fileNamePrefix The prefix (optionally including a file path) of the omitted file. * @param extension The extension of the omitted file. */ public void saveModels(Notifier model, String fileNamePrefix, String extension) { globalContext.getSolutionStore().saveModels(model, new IdBasedSolutionNameProvider(fileNamePrefix, extension)); }
@Override public void initStrategy(ThreadContext context) { this.context = context; this.solutionStore = context.getGlobalContext().getSolutionStore(); final ObjectiveComparatorHelper objectiveComparatorHelper = context.getObjectiveComparatorHelper(); trajectoiresToExplore = new PriorityQueue<TrajectoryWithFitness>(11, (o1, o2) -> objectiveComparatorHelper.compare(o2.fitness, o1.fitness)); }
@Override public void initStrategy(ThreadContext context) { this.context = context; this.solutionStore = context.getGlobalContext().getSolutionStore(); GlobalContext globalContext = context.getGlobalContext(); if (globalContext.getSharedObject() == null) { isFirstThread = true; shared = new BfsSharedObject(globalContext.getThreadPool().getMaximumPoolSize()); globalContext.setSharedObject(shared); logger.info("Breadth-first exploration strategy is inited."); } else { shared = (BfsSharedObject) globalContext.getSharedObject(); } }