public class Individual
extends java.lang.Object
Population
Constructor and Description |
---|
Individual()
Builds an individual instance without content.
|
Individual(java.lang.String idxPrefix)
Builds an individual instance without content.
|
Modifier and Type | Method and Description |
---|---|
org.opencv.core.Mat |
getContent() |
java.lang.String |
getIdxPrefix() |
Individual |
getParent() |
org.opencv.core.Rect |
getParentRect() |
Population |
getPopulation() |
java.lang.String |
getTargetFileName(java.lang.String path)
Get the full target file name.
|
boolean |
hasParent() |
boolean |
loadContent(java.lang.String fileName)
Load the content of this individual from a file.
|
boolean |
loadCsv(java.lang.String fileName)
Load the content from a CSV file.
|
Individual |
produceChild(org.opencv.core.Rect roi)
Produce a child from a submatrix of the content.
|
Individual |
produceChild(org.opencv.core.Rect roi,
boolean setContent)
Produce a child from a submatrix of the content.
|
void |
setContent(org.opencv.core.Mat content)
Set individual content.
|
void |
setIdxPrefix(java.lang.String idxPrefix) |
void |
setParent(Individual parent,
org.opencv.core.Rect parentRect)
Set a new parent.
|
void |
setPopulation(Population pop)
Set the population this individual belongs to.
|
boolean |
store(java.lang.String path)
Write the content of this individual into a file.
|
boolean |
storeCsv(java.lang.String fileName)
Store the content as csv file (only the first channel).
|
public Individual()
public Individual(java.lang.String idxPrefix)
idxPrefix
- prefix to be prepend when substituting %idxpublic void setPopulation(Population pop)
pop
- new population instancepublic boolean hasParent()
public Individual getParent()
public org.opencv.core.Rect getParentRect()
public void setParent(Individual parent, org.opencv.core.Rect parentRect)
parent
- parent individualparentRect
- region of the children within the parentpublic Population getPopulation()
public boolean loadContent(java.lang.String fileName)
fileName
- path to the filepublic java.lang.String getIdxPrefix()
public org.opencv.core.Mat getContent()
public void setIdxPrefix(java.lang.String idxPrefix)
idxPrefix
- the index prefix to set. The index prefix is a string
that is inserted when %idx is substitutedpublic boolean store(java.lang.String path)
path
- Path with placeholders to the target files. See the
-outputPath parameterjava.lang.NullPointerException
- if fileNamePattern is null or the content
of this individual is null or if the population was not setsetPopulation(Population)
public java.lang.String getTargetFileName(java.lang.String path)
path
- Path with placeholders to the target files. See the
-outputPath parameterpublic boolean storeCsv(java.lang.String fileName)
fileName
- path to the file to write (without placeholders)java.lang.NullPointerException
- if fileName or content is nullpublic boolean loadCsv(java.lang.String fileName)
fileName
- path to the CSV file (without placeholders)public void setContent(org.opencv.core.Mat content)
content
- new contentpublic Individual produceChild(org.opencv.core.Rect roi)
roi
- region in content of this childjava.lang.NullPointerException
- if content or roi is nullpublic Individual produceChild(org.opencv.core.Rect roi, boolean setContent)
roi
- region in content of this childsetContent
- set child content to submatrixjava.lang.NullPointerException
- if content or roi is null