R6 class representing the current modello session
R6 class representing the current modello session
.initstores the init status of the session (TRUE/FALSE)
.n.numbersnumber of allocate slot for storing number
.numbersenvironment keeping track of the created numbers
.n.nodesnumber of slot allocated for storing nodes
.n.graphsnumber of slots allocated for storing graphs
.graphsenvironement keeping track of the created graphs
.n.optsnumber of slots allocated for storing optimisers
.optsenvironment 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.numbersnumber of numbers
n.nodesnumber of nodes
n.graphsnumber of graphs
n.optsnumber 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)
typcharcter 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)
idnumber id
namenumber name
number.name.exists()Checks if a number name exists.
.modello.session$number.name.exists(name)
namenumber 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)
shpnumber shape
dxif TRUE allocate a derivative array for the number
namecharacter, 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)
namenumber 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)
xreference 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)
xreference 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)
xreference 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, ...)
opoperator name
...operator parameters
namename 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)
idgraph id
Returns a reference object of class 'graph'
graph.name.exists()Checks if a graph name exists.
.modello.session$graph.name.exists(name)
namegraph 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)
greference 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)
namegraph name
Returns a reference object of class 'graph'.
pop.graph()Pops (removes) a graph from the GRAPHS_ array.
.modello.session$pop.graph(x)
xreference 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)
xreference 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)
xreference 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)
idoptimiser id
optR6 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)
nameoptimiser 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, ...)
appendinterface function for appending the optimiser to GOPTS_
optcharacter 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)
nameoptimiser 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)
xreference 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)
xreference 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)
xreference 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)
deepWhether to make a deep clone.
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.