Map<String, List<AttributeType>> aslaParams = null;
Map<String, Set<Resource>> optimisationSpace = null;
IOptimisationAlgorithm optAlg = null;
AModel appModel = null;
AObjectiveFunction objFunc = null;
IOptimisationManager opt;
boolean valid = false;
//--- Setting up various things required by several components ---//
optUtil = OptimiserUtil.getInstance();
classLoader = new PESClassLoader();
daoFactory = DAOFactory.createInstance(DAOFactory.HIBERNATE);
estimationResult = new EstimationResult();
priceCalculator = new SamplePriceCalculator();
//--- Setting up ASLA parameters and optimisation space ---//
aslaParams = setUpASLAParams();
optimisationSpace = setUpOptimisationSpace();
//--- Setting up optimiser components from XML files ---//
optAlg = setUpOptAlg(args[optAlgIdx]);
appModel = setUpAppModel(args[modelIdx], daoFactory);
objFunc = setUpObjFunc(args[objFuncIdx], appModel, priceCalculator, estimationResult, daoFactory, args[workspaceIdx], aslaParams);
//--- Creating and initialising the Optimiser ---//
opt = new OptimisationManager();
valid = opt.init(optimisationSpace, optAlg, objFunc, priceCalculator, args[workspaceIdx], estimationResult, daoFactory);
if (!valid)
throw new RuntimeException("ERROR: Optimiser could not be initialised");
//--- Disabling caching to allow this to execute stand-alone ---//
optUtil.disableDBCaching = true;