Forest.pm

Summary
Forest.pm
BE4::ForestCreates and manages all graphs, NNGraph and QTree.
Constructors
newForest constructor.
_initChecks parameters and stores the pyramid.
_loadCreates a NNGraph or a QTree object per data source and a Commands object.
Graphs tools
containsNodeReturns a boolean : TRUE if the node belong to this forest, FALSE otherwise (if a parameter is not defined too).
computeGraphsComputes each NNGraph or QTree one after the other and closes scripts to finish.
Getters - Setters
getGraphs
getPyramid
getScripts
getScript
getWeightOfScript
setWeightOfScript
getSplitNumber
Export methods
exportForDebugReturns all informations about the forest.

BE4::Forest

Exporter
BE4::Forest

Creates and manages all graphs, NNGraph and QTree.

We have several kinds of graphs and their using have to be transparent for the forest.  That’s why we must define functions for all graph’s types (as an interface) :

Using

use BE4::Forest

my $Forest = BE4::Forest->new(
    $objPyramid, # a BE4::Pyramid object
    $objDSL, # a BE4::DataSourceLoader object
    $param_process, # a hash with following keys : job_number, path_temp, path_temp_common and path_shell
);

Attributes

pyramidPyramid - Images’ pyramid to generate, thanks to one or several graphs.
commandsCommands - To compose generation commands (mergeNtiff, tiff2tile...).
graphsQTree or NNGraph array - Graphs composing the forest, one per data source.
scriptsScript array - Scripts, whose execution generate the images’ pyramid.
splitNumberinteger - Number of script used for work parallelization.
Summary
Constructors
newForest constructor.
_initChecks parameters and stores the pyramid.
_loadCreates a NNGraph or a QTree object per data source and a Commands object.
Graphs tools
containsNodeReturns a boolean : TRUE if the node belong to this forest, FALSE otherwise (if a parameter is not defined too).
computeGraphsComputes each NNGraph or QTree one after the other and closes scripts to finish.
Getters - Setters
getGraphs
getPyramid
getScripts
getScript
getWeightOfScript
setWeightOfScript
getSplitNumber
Export methods
exportForDebugReturns all informations about the forest.

Constructors

new

sub new

Forest constructor.  Bless an instance.

Parameters (list)

pyrPyramid - Contains output format specifications, needed by generations command’s.
DSLDataSourceLoader - Contains one or several data sources
params_processhash - Informations for scripts
job_number - integer - Parallelization level
path_temp - string - Temporary directory
path_temp_common - string - Common temporary directory
path_shell - string - Script directory

See also

_init, _load

_init

sub _init

Checks parameters and stores the pyramid.

Parameters (list)

pyrPyramid - Contains output format specifications, needed by generations command’s.
DSLDataSourceLoader - Contains one or several data sources
params_processhash - Informations for scipts, where to write them, temporary directory to use...
job_number - integer - Parallelization level
path_temp - string - Temporary directory
path_temp_common - string - Common temporary directory
path_shell - string - Script directory

_load

sub _load

Creates a NNGraph or a QTree object per data source and a Commands object.  Using a QTree is faster but it does’nt match all cases.

All differences between different kinds of graphs are handled in respective classes, in order to be imperceptible for users.

Only scripts creation and initial organization are managed by the forest.

Parameters (list)

pyrPyramid - Contains output format specifications, needed by generations command’s.
DSLDataSourceLoader - Contains one or several data sources
params_processhash - Informations for scipts, where to write them, temporary directory to use...
job_number - integer - Parallelization level
path_temp - string - Temporary directory
path_temp_common - string - Common temporary directory
path_shell - string - Script directory

Graphs tools

containsNode

sub containsNode

Returns a boolean : TRUE if the node belong to this forest, FALSE otherwise (if a parameter is not defined too).

Parameters (list)

levelstring - Level ID of the node we want to know if it is in the forest.
iinteger - Column of the node we want to know if it is in the forest.
jinteger - Row of the node we want to know if it is in the forest.

computeGraphs

sub computeGraphs

Computes each NNGraph or QTree one after the other and closes scripts to finish.

See Also

NNGraph::computeYourself, QTree::computeYourself

Getters - Setters

getGraphs

sub getGraphs

getPyramid

sub getPyramid

getScripts

sub getScripts

getScript

sub getScript

Parameters (list)

indinteger - Script’s indice in the array

getWeightOfScript

sub getWeightOfScript

Parameters (list)

indinteger - Script’s indice in the array

setWeightOfScript

sub setWeightOfScript

Parameters (list)

indinteger - Script’s indice in the array
weightinteger - Script’s weight to set

getSplitNumber

sub getSplitNumber

Export methods

exportForDebug

sub exportForDebug

Returns all informations about the forest.  Useful for debug.

Example

Representation of a “nearest neighbour” pyramid : pyramid’s image = Node.
Representation of a quad tree image pyramid : pyramid’s image = Node
sub new
Forest constructor.
sub _init
Checks parameters and stores the pyramid.
sub _load
Creates a NNGraph or a QTree object per data source and a Commands object.
Configure and assemble commands used to generate pyramid’s images.
sub containsNode
Returns a boolean : TRUE if the node belong to this forest, FALSE otherwise (if a parameter is not defined too).
sub computeGraphs
Computes each NNGraph or QTree one after the other and closes scripts to finish.
sub getGraphs
sub getPyramid
sub getScripts
sub getScript
sub getWeightOfScript
sub setWeightOfScript
sub getSplitNumber
sub exportForDebug
Returns all informations about the forest.
sub computeYourself
sub computeYourself
Determine codes and weights for each node of the current QTree, and share work on scripts, so as to optimize execution time.
sub containsNode
Returns a boolean : TRUE if the node belong to this tree, FALSE otherwise (if a parameter is not defined too).
sub containsNode
Returns a boolean : TRUE if the node belong to this tree, FALSE otherwise (if a parameter is not defined too).
sub exportForDebug
Returns all informations about the “nearest neighbour” graph.
sub exportForDebug
Returns all informations about the quad tree.
Store all informations about a pyramid.
Describe a script, its weight and allowed to write in.
Loads, validates and manages data sources.
Close