public class ResultFileReader extends java.lang.Object implements java.io.Closeable, java.util.Iterator<ResultEntry>, java.lang.Iterable<ResultEntry>
ResultFileWriter
. See the documentation
for ResultWriter
for a description of the file format.
This reader is expected to gracefully recover from incomplete or improperly
formatted files. Unless a serious I/O error occurred, this reader will
attempt to load the file to the last valid entry. This requirement enables a
ResultWriter
to resume processing at a valid state.
ResultFileWriter
Constructor and Description |
---|
ResultFileReader(Problem problem,
java.io.File file)
Constructs a result file reader for reading the approximation sets from
the specified result file.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Variable |
decode(Variable variable,
java.lang.String string)
Decodes string representations of decision variables, returning the
variable with the decoded value.
|
boolean |
hasNext() |
java.util.Iterator<ResultEntry> |
iterator() |
ResultEntry |
next() |
void |
remove() |
public ResultFileReader(Problem problem, java.io.File file) throws java.io.IOException
problem
- the problemfile
- the file containing the resultsjava.io.IOException
- if an I/O error occurredpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public ResultEntry next()
next
in interface java.util.Iterator<ResultEntry>
public java.util.Iterator<ResultEntry> iterator()
iterator
in interface java.lang.Iterable<ResultEntry>
public boolean hasNext()
hasNext
in interface java.util.Iterator<ResultEntry>
public void remove()
remove
in interface java.util.Iterator<ResultEntry>
public Variable decode(Variable variable, java.lang.String string)
variable
- the decision variablestring
- the string representation of the decision variableResultFileWriter.encode(Variable)
Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.