Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK::Conveyor Class Reference

#include <APPSPACK_Conveyor.hpp>

Collaboration diagram for APPSPACK::Conveyor:

Collaboration graph
[legend]
List of all members.

Detailed Description

The conveyor's main interface is the exchange() function. It takes a (possibly empty) list of unevaluated trial points and returns a (non-empty) list of evaluated trial points with function values.

The conveyor owns an APPSPACK::List for the queue of trial points to be evaluated; see queueList.

The conveyor owns a APPSPACK::Cache::Manager to manage the cache; see cache.

The conveyor owns a user-provided APPSPACK::Executor object for the function evaluations; see executor. The points that have been passed to the executor but have not yet finished are stored an APPSPACK::List; see pendingList.

Definition at line 69 of file APPSPACK_Conveyor.hpp.

Public Member Functions

 Conveyor (Parameter::List &params, const Vector &scaling_in, Executor::Interface &executor_in)
 Constructor.
 ~Conveyor ()
 Destructor.
void exchange (List &exchangeList)
 Exchange a list of unevaluated trial points for a list of evaluated trial points.
void prune ()
 Prune the queue to the size specified by maxQueue.
const CountergetCounter () const
 Returns counts of all the function evaluations, etc.
void print () const
 Calls the print function of the executor.

Private Attributes

Executor::Interfaceexecutor
 Object that is used to evaluate the function.
Cache::Manager cache
 The function value cache.
List queueList
 Trial points that are queued to be processed.
List pendingList
 Trial points that are in the processed of being evaluated.
bool doSync
 Be synchronous (set according to "Synchronous").
int maxQueue
 How big the queue is allowed to be after a prune (set according to "Max Queue Size" parameter).
int minReturn
 The minimum number of items that should be returned on a call to exchange() (set according to "Minimum Exchange Return").
int maxReturn
 The maximum number of items that should be returned on a call to exchange() (set according to "Maximum Exchange Return").
Counter counter
 Counter for the number of evaluations, etc.


Constructor & Destructor Documentation

APPSPACK::Conveyor::Conveyor Parameter::List params,
const Vector scaling_in,
Executor::Interface executor_in
 

Constructor.

Definition at line 40 of file APPSPACK_Conveyor.cpp.

APPSPACK::Conveyor::~Conveyor  ) 
 

Destructor.

Definition at line 53 of file APPSPACK_Conveyor.cpp.

References pendingList, APPSPACK::List::prune(), and queueList.


Member Function Documentation

void APPSPACK::Conveyor::exchange List exchangeList  ) 
 

Exchange a list of unevaluated trial points for a list of evaluated trial points.

On input, remove all the trial points from the list. On output, fill with trial points that have been evaluated.

The process is as follows.

  • Remove all the points (if any) from the input list (exchangeList) and insert them into the queue (queueList).

  • Collect points to be returned (in exchangeList). So long as the return list is smaller than the minimum return size (minReturn) and there are still points to be evaluated (i.e., either the queue is non-empty and/or the pending list is non-empty):

    • While the queue is non-empty and the executor is not full:

      • Pop the next trial point off the queue.

      • Check to see if that trial point is cached. If it is cached, increment the cached value count, fill in the function value, and add this trial point to the return list.

      • Otherwise, spawn an evaluation of the trial point using the executor and push the trial point onto the pending list.

    • While the executor has a function value to return and the exchange list is not full:

      • Increment the number of function evaluations.

      • Pop the appropriate point off the pending list and fill in the function value.

      • Insert the new information into the queue for future looks.

      • Add the trial point onto the return list.

Definition at line 64 of file APPSPACK_Conveyor.cpp.

References cache, counter, executor, APPSPACK::Counter::getCountString(), APPSPACK::Point::getTag(), APPSPACK::Point::getX(), APPSPACK::Counter::incrementCached(), APPSPACK::Counter::incrementEvaluated(), APPSPACK::Cache::Manager::insert(), APPSPACK::List::insertList(), APPSPACK::Cache::Manager::isCached(), APPSPACK::List::isNotEmpty(), APPSPACK::Executor::Interface::isWaiting(), pendingList, APPSPACK::List::pop(), APPSPACK::List::push(), queueList, APPSPACK::Executor::Interface::recv(), APPSPACK::Point::setCachedFunctionValue(), APPSPACK::Point::setEvaluatedFunctionValue(), APPSPACK::List::size(), and APPSPACK::Executor::Interface::spawn().

Referenced by APPSPACK::Solver::iterate().

void APPSPACK::Conveyor::prune  ) 
 

Prune the queue to the size specified by maxQueue.

Definition at line 109 of file APPSPACK_Conveyor.cpp.

References maxQueue, APPSPACK::List::prune(), and queueList.

Referenced by APPSPACK::Solver::processEvaluatedTrialPoints().

const APPSPACK::Counter & APPSPACK::Conveyor::getCounter  )  const
 

Returns counts of all the function evaluations, etc.

Definition at line 59 of file APPSPACK_Conveyor.cpp.

Referenced by APPSPACK::Solver::processEvaluatedTrialPoints(), and APPSPACK::Solver::solve().

void APPSPACK::Conveyor::print  )  const
 

Calls the print function of the executor.

Definition at line 114 of file APPSPACK_Conveyor.cpp.

References executor, and APPSPACK::Executor::Interface::print().


Member Data Documentation

Executor::Interface& APPSPACK::Conveyor::executor [private]
 

Object that is used to evaluate the function.

This object is passed in to the constructor

Definition at line 150 of file APPSPACK_Conveyor.hpp.

Referenced by exchange(), and print().

Cache::Manager APPSPACK::Conveyor::cache [private]
 

The function value cache.

Definition at line 153 of file APPSPACK_Conveyor.hpp.

Referenced by exchange().

List APPSPACK::Conveyor::queueList [private]
 

Trial points that are queued to be processed.

Definition at line 156 of file APPSPACK_Conveyor.hpp.

Referenced by exchange(), prune(), and ~Conveyor().

List APPSPACK::Conveyor::pendingList [private]
 

Trial points that are in the processed of being evaluated.

Definition at line 159 of file APPSPACK_Conveyor.hpp.

Referenced by exchange(), and ~Conveyor().

bool APPSPACK::Conveyor::doSync [private]
 

Be synchronous (set according to "Synchronous").

Definition at line 162 of file APPSPACK_Conveyor.hpp.

int APPSPACK::Conveyor::maxQueue [private]
 

How big the queue is allowed to be after a prune (set according to "Max Queue Size" parameter).

Definition at line 165 of file APPSPACK_Conveyor.hpp.

Referenced by prune().

int APPSPACK::Conveyor::minReturn [private]
 

The minimum number of items that should be returned on a call to exchange() (set according to "Minimum Exchange Return").

Definition at line 169 of file APPSPACK_Conveyor.hpp.

int APPSPACK::Conveyor::maxReturn [private]
 

The maximum number of items that should be returned on a call to exchange() (set according to "Maximum Exchange Return").

Definition at line 173 of file APPSPACK_Conveyor.hpp.

Counter APPSPACK::Conveyor::counter [private]
 

Counter for the number of evaluations, etc.

Definition at line 176 of file APPSPACK_Conveyor.hpp.

Referenced by exchange().


The documentation for this class was generated from the following files:

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002