19package denoptim.programs.grapheditor;
22import java.lang.reflect.Field;
23import java.util.ArrayList;
24import java.util.logging.Level;
26import org.openscience.cdk.interfaces.IAtomContainer;
28import denoptim.exception.DENOPTIMException;
29import denoptim.files.FileFormat;
30import denoptim.files.FileUtils;
31import denoptim.graph.DGraph;
32import denoptim.io.DenoptimIO;
33import denoptim.logging.StaticLogger;
34import denoptim.programs.RunTimeParameters;
35import denoptim.utils.GraphEdit;
54 private ArrayList<DGraph>
inGraphs =
new ArrayList<DGraph>();
59 private ArrayList<IAtomContainer>
inMols;
147 switch (key.toUpperCase())
155 case "ENFORCESYMMETRY=":
156 if (value.toUpperCase().equals(
"YES")
157 || value.toUpperCase().equals(
"Y"))
162 case "GRAPHSEDITSFILE=":
165 case "OUTPUTGRAPHS=":
168 case "OUTPUTGRAPHSFORMAT=":
169 switch (value.toUpperCase())
191 msg =
"Unable to understand value " + key +
"'" + value +
"'";
196 msg =
"Keyword " + key +
" is not a known GraphEditor-"
197 +
"related keyword. Check input files.";
212 StringBuilder sb =
new StringBuilder(1024);
214 for (Field f : this.getClass().getDeclaredFields())
218 sb.append(f.getName()).append(
" = ").append(
219 f.get(
this)).append(
NL);
224 +
" parameters. Cause: " + t);
230 sb.append(otherCollector.getPrintedList());
232 return sb.toString();
247 msg =
"Directory " +
workDir +
" not found. Please specify an "
248 +
"existing directory.";
254 msg =
"Input file with graphs to edit not defined. Check you input.";
259 msg =
"File with input graphs not found. Check " +
inGraphsFile;
265 msg =
"File with graph editing tasks not found. Check " +
295 String msg =
"Ouput file '" +
outGraphsFile +
"' exists already!";
309 throw new Error(
"Cannot read in graph editing tasks from "
326 String msg =
"Cannot read in graphs from " +
inGraphsFile;
static boolean checkExists(String fileName)
Utility methods for input/output.
static ArrayList< DGraph > readDENOPTIMGraphsFromFile(File inFile)
Reads a list of <DGraphs from file.
static ArrayList< GraphEdit > readDENOPTIMGraphEditFromFile(String fileName)
Reads a list of graph editing tasks from a JSON file.
Logger class for DENOPTIM.
static final Logger appLogger
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
String paramTypeName()
Returns a string defining the type the parameters collected here.
void checkOtherParameters()
Checks any of the parameter collections contained in this instance.
String workDir
Working directory.
final String NL
New line character.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
int verbosity
Verbosity level for logger.
Parameters controlling execution of GraphEditor.
void checkParameters()
Evaluate consistency of input parameters.
void processParameters()
Processes all parameters and initialize related objects.
ArrayList< GraphEdit > graphEdits
Graph's editing tasks.
String inGraphsFile
File with input graphs.
String outGraphsFile
File with output graphs.
IAtomContainer getInpMol(int i)
ArrayList< IAtomContainer > inMols
Input molecular objects.
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
ArrayList< DGraph > inGraphs
Input graphs.
ArrayList< DGraph > getInputGraphs()
GraphEdParameters()
Constructor.
FileFormat outGraphsFormat
FileFormat getOutFormat()
String graphEditsFile
File with list of edit tasks.
boolean symmetry
Flag controlling strategy with respect to symmetry.
ArrayList< GraphEdit > getGraphEditTasks()
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
Identifier of the type of parameters.
GE_PARAMS
Parameters controlling the stand-alone editing of graphs.