Search in sources :

Example 1 with SolverFactory

use of pcgen.base.solver.SolverFactory in project pcgen by PCGen.

the class PlayerCharacter method doFormulaSetup.

private void doFormulaSetup(LoadContext context) {
    SplitFormulaSetup formulaSetup = formulaSetupFacet.get(id.getDatasetID());
    MonitorableVariableStore varStore = new MonitorableVariableStore();
    IndividualSetup mySetup = new IndividualSetup(formulaSetup, "Global", varStore);
    scopeFacet.set(id, mySetup.getInstanceFactory());
    variableStoreFacet.set(id, varStore);
    SolverFactory solverFactory = solverFactoryFacet.get(id.getDatasetID());
    solverManagerFacet.set(id, new DynamicSolverManager(mySetup.getFormulaManager(), context.getVariableContext().getManagerFactory(), solverFactory, varStore));
}
Also used : SplitFormulaSetup(pcgen.base.solver.SplitFormulaSetup) DynamicSolverManager(pcgen.base.solver.DynamicSolverManager) IndividualSetup(pcgen.base.solver.IndividualSetup) SolverFactory(pcgen.base.solver.SolverFactory) MonitorableVariableStore(pcgen.cdom.formula.MonitorableVariableStore)

Example 2 with SolverFactory

use of pcgen.base.solver.SolverFactory in project pcgen by PCGen.

the class InputFunctionTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    getFunctionLibrary().addFunction(new InputFunction());
    formulaSetupFacet.initialize(context);
    solverFactoryFacet.initialize(context);
    FacetLibrary.getFacet(VariableLibraryFacet.class).initialize(context);
    id = CharID.getID(context.getDataSetID());
    scopeFacet.set(id, getInstanceFactory());
    variableStoreFacet.set(id, (MonitorableVariableStore) getVariableStore());
    SolverFactory solverFactory = solverFactoryFacet.get(id.getDatasetID());
    solverManagerFacet.set(id, new AggressiveSolverManager(getFormulaManager(), getManagerFactory(), solverFactory, getVariableStore()));
}
Also used : SolverFactory(pcgen.base.solver.SolverFactory) VariableLibraryFacet(pcgen.cdom.facet.VariableLibraryFacet) AggressiveSolverManager(pcgen.base.solver.AggressiveSolverManager)

Aggregations

SolverFactory (pcgen.base.solver.SolverFactory)2 AggressiveSolverManager (pcgen.base.solver.AggressiveSolverManager)1 DynamicSolverManager (pcgen.base.solver.DynamicSolverManager)1 IndividualSetup (pcgen.base.solver.IndividualSetup)1 SplitFormulaSetup (pcgen.base.solver.SplitFormulaSetup)1 VariableLibraryFacet (pcgen.cdom.facet.VariableLibraryFacet)1 MonitorableVariableStore (pcgen.cdom.formula.MonitorableVariableStore)1