Class InstanceManager<I extends Instance>
java.lang.Object
es.urjc.etsii.grafo.io.InstanceManager<I>
- Type Parameters:
I- Instance class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final es.urjc.etsii.grafo.io.InstanceCache<I> static final Stringprotected final InstanceConfigurationprotected final InstanceImporter<I> protected final es.urjc.etsii.grafo.io.WarmupInstanceSelector<I> -
Constructor Summary
ConstructorsConstructorDescriptionInstanceManager(InstanceConfiguration instanceConfiguration, SolverConfig solverConfig, InstanceImporter<I> instanceImporter) Build instance manager -
Method Summary
Modifier and TypeMethodDescriptiongetInstance(String path) Returns an instance given a load path.getInstanceSolveOrder(String expName) getInstanceSolveOrder(String expName, boolean preload) Get which instances have to be solved for a given experimentgetWarmupInstancePath(String expName, List<String> instancePaths) Select the instance path that should be used for JVM warm-up.protected IloadInstance(String path) voidPurge instance cacherequireConfiguredInstancePath(String expName, String requestedPath) Verify that a user supplied load path belongs to the configured instance source for an experiment.protected voidvalidateAndSort(String expName, List<String> instancePaths)
-
Field Details
-
INDEX_SUFFIX
- See Also:
-
instanceConfiguration
-
instanceImporter
-
cache
-
warmupSelector
-
solveOrderByExperiment
-
authorizedLoadPathsByExperiment
-
-
Constructor Details
-
InstanceManager
@Autowired public InstanceManager(InstanceConfiguration instanceConfiguration, SolverConfig solverConfig, InstanceImporter<I> instanceImporter) Build instance manager- Parameters:
instanceConfiguration- instance configurationsolverConfig- solver configurationinstanceImporter- instance importer
-
-
Method Details
-
getInstanceSolveOrder
-
getInstanceSolveOrder
Get which instances have to be solved for a given experiment- Parameters:
expName- experiment name as stringpreload- if true load instances to use comparator to sort them, if false uses lexicograph sort by path name- Returns:
- Ordered list of instance load paths, that can be later used by the getInstance method. Instances should be solved in the returned order.
-
validateAndSort
-
getWarmupInstancePath
-
lexicSort
-
requireConfiguredInstancePath
Verify that a user supplied load path belongs to the configured instance source for an experiment. This is intended for external callbacks, where the path is supplied by a client instead of being produced bygetInstanceSolveOrder(String).- Parameters:
expName- experiment namerequestedPath- user supplied instance load path- Returns:
- the canonical configured load path that should be used for loading
-
validate
-
getInstance
-
loadInstance
-
purgeCache
public void purgeCache()Purge instance cache -
getUserImporterImplementation
-