Description Details Public fields Methods Author(s)
R6 class representing the current modello session
R6 class representing the current modello session
An object of this class called '.modello' is created when the package is loaded and will do the booking keeping of what happens during the session.
.init
stores the init status of the session (TRUE/FALSE)
.n.numbers
number of allocate slot for storing number
.numbers
environment keeping track of the created numbers
.n.nodes
number of slot allocated for storing nodes
.n.graphs
number of slots allocated for storing graphs
.graphs
environement keeping track of the created graphs
.n.opts
number of slots allocated for storing optimisers
.opts
environment keeping track of the created optimisers
new()
modello session object initialisation method. It does nothgin, it is just use on package load to create the .modello object containing the session.
.modello.session$new()
init()
Allocates all the arrays necessary to the session
.modello.session$init(n.numbers, n.nodes, n.graphs, n.opts)
n.numbers
number of numbers
n.nodes
number of nodes
n.graphs
number of graphs
n.opts
number of optimisers
Returns invisible NULL.
close()
Deallocates all the session arrays
.modello.session$close()
Returns invisible NULL.
reset()
Reset the session by deallocating and reallocating all the arrays. The data in the arrays is lost.
.modello.session$reset()
Returns invisible NULL.
finalize()
Closes the session if its object is destroyed.
.modello.session$finalize()
next.name()
build unique random number ideintifying a number
,
graph
or optimizer
.
.modello.session$next.name(typ)
typ
charcter indicating the type of object.
new.number()
Creates a new number
and return the corresponding
reference object of class 'number'
.modello.session$new.number(id, name = NULL)
id
number
id
name
number
name
number.name.exists()
Checks if a number
name exists.
.modello.session$number.name.exists(name)
name
number
name
Returns TRUE if the name exists, FALSE otherwise
append.number()
Append a number
of the given shape to the
NUMBER_
array. A link to the number
is create the numbers
environment within the
session object. This method is called each time
a new number
is created.
.modello.session$append.number(shp, dx, name = NULL)
shp
number
shape
dx
if TRUE allocate a derivative array for the number
name
character, number
name. Only for loading saved numbers
Returns an object of class 'number' referring
to the appended number
get.number()
Given a name (character identifier) for a number
creates and returns a reference objects of class 'number'.
.modello.session$get.number(name)
name
number
name
Returns a object of class 'number'
pop.number()
Pops (removes) a number
fro the NUMBERS_
array
according to the provided reference object.
.modello.session$pop.number(x)
x
reference object of class 'number'
Returns invisible x.
number.id()
Given a reference object of class 'number', retrives and
returs the id of the associated nummber
(i.e. its position in the NUMBERS_
array.
.modello.session$number.id(x)
x
reference object of class 'number'
Returns the number
id
number.exists()
Checks that the number
associated to a referece
object of class 'number' exists.
.modello.session$number.exists(x)
x
reference object of class 'number'
Returns TRUE if the number
exists, FALSE otherwise.
number.gc()
Calls the number
garbage collector.
.modello.session$number.gc()
Returns invisible NULL
apply.math_op()
Applies a mathematical operator to its arguments.
.modello.session$apply.math_op(op, ...)
op
operator name
...
operator parameters
name
name of the output number
. If NULL is automatically generated
Returns a number
new.graph()
Creates a new graph
and return the corresponding
reference object of class 'graph'
.modello.session$new.graph(id)
id
graph
id
Returns a reference object of class 'graph'
graph.name.exists()
Checks if a graph
name exists.
.modello.session$graph.name.exists(name)
name
graph
name
Returns TRUE if the name exists, FALSE otherwise
graph.open()
Opens a graph
.
if g
is NULL a new graph is open and appended to the
graph
array. If a reference object
of class 'graph' is porvided the corresponding graph
is open.
.modello.session$graph.open(g = NULL)
g
reference object of class 'graph'
Returns an reference object of class 'graph'
get.graph()
Given a graph
name (character identifier) creates
and returns a reference object of class 'graph'.
.modello.session$get.graph(name)
name
graph
name
Returns a reference object of class 'graph'.
pop.graph()
Pops (removes) a graph
from the GRAPHS_
array.
.modello.session$pop.graph(x)
x
reference object of class 'graph'
Returns invisible x.
graph.id()
Given a reference object of class 'graph', retunrs
the id (i.e. position in the GRAPHS_
array)
of the associated graph
.
.modello.session$graph.id(x)
x
reference object of class 'graph'
Returns the graph
id
graph.exists()
Checks that the graph
associated to a referece
object of class 'graph' exists.
.modello.session$graph.exists(x)
x
reference object of class 'graph'
Returns TRUE if the graph
exists, FALSE otherwise.
graph.gc()
Calls the graph
garbage collector.
.modello.session$graph.gc()
Returns invisible NULL
new.opt()
Creates a new optimiser
and return the corresponding
reference object of class 'opt'
.modello.session$new.opt(id, opt)
id
optimiser
id
opt
R6 class indentifying the kind of optimiser
Returns a reference object of class 'opt'
opt.name.exists()
Checks if a optimiser
name exists.
.modello.session$opt.name.exists(name)
name
optimiser
name
Returns TRUE if the name exists, FALSE otherwise
append.opt()
Append an optimiser
with the given parameters to
the OPTS_
array. A link to the optimiser
is created in .opt
environment within the
session object. This method is called each time
a new optimiser
is created.
.modello.session$append.opt(append, opt, ...)
append
interface function for appending the optimiser to GOPTS_
opt
character dincating the kind of optimiser
...
optmiser parameters
Returns an object of class 'opt' referring
to the appended optmiser
get.opt()
Given a name (character identifier) for an optimiser
creates and returns a reference objects of class 'opt'.
.modello.session$get.opt(name)
name
optimiser
name
Returns a object of class 'opt'
pop.opt()
Pops (removes) an optmiser
from the OPTS_
array
according to the provided reference object.
.modello.session$pop.opt(x)
x
reference object of class 'opt'
Returns invisible x.
opt.id()
Given a reference object of class 'opt', retrives and
returs the id of the associated optmiser
(i.e. its position in the OPTS_
array.
.modello.session$opt.id(x)
x
reference object of class 'opt'
Returns the optmiser
id
opt.exists()
Checks that the optmiser
associated to a referece
object of class 'opt' exists.
.modello.session$opt.exists(x)
x
reference object of class 'opt'
Returns TRUE if the optmiser
exists, FALSE otherwise.
clone()
The objects of this class are cloneable with this method.
.modello.session$clone(deep = FALSE)
deep
Whether to make a deep clone.
Filippo Monari
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.