NAME

GT::ArgsTree - Represent the arguments of calculation objects (indics/signals/systems)


DESCRIPTION

Each calculation object can be parameterized with arguments. But those arguments can themselves be calculation objects. This is represented by a complex syntax that this module can understand and use to create a tree of arguments.


SYNTAX

The argument list is a space separated list of arguments. However when the argument is not a readable value but a computable one, it should be given with a different syntax :

  { I::Indicator <indic_arg_list> }


AVAILABLE FUNCTIONS

GT::ArgsTree->new(@args)

Create an ArgsTree object for the given list of arguments. Instead of a list you can give a string representation of all the arguments.

$at->add_args(@args)

Process the list of arguments and adds them to the arguments tree.

$at->create_objects()

Creates the required objects to compute the various arguments.

$at->is_constant($arg_number)
$at->is_constant()

Return true if the corresponding argument is of constant value (ie it doesn't have to be computed each time). If no argument is given, then return true if all arguments are constant.

The first argument is numbered "1" (and not "0").

$at->get_arg_values($calc, $day)
$at->get_arg_values($calc, $day, $n)

Return the (computed) value of the indicated argument. Returns the list of values of all arguments if no parameter is given.

The first argument is numbered "1" (and not "0").

$at->get_arg_constant($n)

Return the constant value of the given argument. Make sure to check that the argument is constant before otherwise it will die.

$at->get_arg_object($n)

Return the associated object of the given argument. The object is something able to compute the value of the argument. Make sure the argument is not a constant otherwise it will die.

$at->get_arg_names()
$at->get_arg_names($n)

Return the name the indicated argument. Returns the list of names of all arguments if no parameter is given.

The first argument is numbered "1" (and not "0").

$at->get_nb_args()

Return the number of arguments available.

my ($full_name, @args) = GT::ArgsTree::parse_args($args)

Parse the arguments in $args and return the parsed content in the form of two arrays (list of arguments).

GT::ArgsTree::args_to_ascii(@args)

Return the ascii representation of all the parameters described in @args.

$args->prepare($calc, $day)

Precalculate all possible values for the given day.

$args->prepare_interval($calc, $first, $last)

Precalculate all possible values for the given interval.