$darkmode
DENOPTIM
FragSpaceExplorer.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.programs.combinatorial;
20
21import java.io.File;
22
23import denoptim.combinatorial.CombinatorialExplorerByLayer;
24import denoptim.fragspace.FragmentSpaceParameters;
25import denoptim.task.ProgramTask;
26
27
52public class FragSpaceExplorer extends ProgramTask
53{
55
56//------------------------------------------------------------------------------
57
63 public FragSpaceExplorer(File configFile, File workDir)
64 {
65 super(configFile, workDir);
66 }
67
68//------------------------------------------------------------------------------
69
70 @Override
71 public void runProgram() throws Throwable
72 {
73 CEBLParameters settings = new CEBLParameters();
74 if (workDir != null)
75 {
76 settings.setWorkDirectory(workDir.getAbsolutePath());
77 }
78 settings.readParameterFile(configFilePathName.getAbsolutePath());
79 settings.checkParameters();
80 settings.processParameters();
82 settings.printParameters();
83
86 }
87
88//------------------------------------------------------------------------------
89
90 protected void handleThrowable()
91 {
92 if (combinatorialAlgorithm != null)
93 {
95 }
96 super.handleThrowable();
97 }
98
99//------------------------------------------------------------------------------
100
101}
Generates all combinators of fragments by means of asynchronous threads.
void stopRun()
Stops all subtasks and shutdown executor.
Logger startProgramSpecificLogger(String loggerIdentifier)
Starts a logger with the given name.
void readParameterFile(String infile)
Read the parameter TXT file line by line and interpret its content.
void printParameters()
Print all parameters.
void setWorkDirectory(String pathname)
Gets the pathname to the working directory.
Parameters controlling execution of the combinatorial algorithm for exploration of a fragment space b...
void processParameters()
Processes all parameters and initialize related objects.
void checkParameters()
Evaluate consistency of input parameters.
Combinatorial exploration of the fragment space.
FragSpaceExplorer(File configFile, File workDir)
Creates and configures the program task.
void handleThrowable()
Method to handle any Throwable originated from the runProgram() method.
Task structure for any of the main programs in the denoptim project, such as genetic algorithm and co...
String loggerIdentifier
Identifier of this program's logger.
File configFilePathName
File containing configuration parameters for the program task.
File workDir
The file system location where we want to be placed when doing the work.
Definition: Task.java:78