push_object: Pushing objects to the master.

View source: R/request_object.R

push_objectR Documentation

Pushing objects to the master.

Description

push objects to the master.

Usage

push_object (object_list, verbose_slave=FALSE)

Arguments

object_list

named list of objects to be pushed to master.

verbose_slave

enable diagnostic messages.

Details

This function pushes an object to the master. Also partial assignments like a[3]=4 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).

Value

none.

Note

The pushed object is assigned in the local frame of the calling master function, or, if not found there, in the globvars environment.

Author(s)

Till Francke

See Also

request_object

Examples


## 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)							

TillF/ppso documentation built on March 11, 2024, 1:27 a.m.