Description Usage Arguments Details Value Note Author(s) See Also Examples
Request an object from the master.
1 | request_object (object_names, verbose_slave=FALSE)
|
object_names |
name(s) of object to be requested from master (string array). |
verbose_slave |
enable diagnostic messages. |
This function requests an object (i.e. variable) from the master. Also partial requests like a[3]
are possible.
This is not necessary for ordinary optimizations! However, it enables the slave to react specifically on the overall conditions of the optimization.
Potentially useful objects are the variables listed and explained in globvars.R (see package source code).
If existing, returns the requested object, otherwise NA
. If multiple objects where requested, a named list is returned, which can conveniently be imported into the current environment (see example).
In serial mode (optim_*), this function basically looks up the search tree and the package environment for the requested objects. In parallel mode (optim_p*), mpi-communications are used.
Till Francke
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
#objective function with additional master-slave interaction
interact_function = function(parms)
{
library(ppso)
X=request_object("X") #request some object
print(paste("X:",X))
flush.console()
print(paste("pushing object..."))
push_object(list("fitness_gbest"=1000)) #push some object
flush.console()
print("returning results...")
return(ackley_function(parms))
}
result = optim_pdds_robust(objective_function=interact_function, projectfile=NULL, logfile=NULL, load_projectfile="no",
max_number_function_calls=20, verbose=TRUE, tryCall=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.