source: colin/trunk/src/Application_SingleObjective.cpp @ 6933

Revision 6933, 2.0 KB checked in by jdsiiro, 4 years ago (diff)

Removing references to ContextMngr?() and replacing with
utilib::TypeManager?() [part of addressing #4226]

Line 
1/*  _________________________________________________________________________
2 *
3 *  Acro: A Common Repository for Optimizers
4 *  Copyright (c) 2008 Sandia Corporation.
5 *  This software is distributed under the BSD License.
6 *  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7 *  the U.S. Government retains certain rights in this software.
8 *  For more information, see the README.txt file in the top Acro directory.
9 *  _________________________________________________________________________
10 */
11
12/**
13 * \file Application_SingleObjective.cpp
14 *
15 * Defines the colin::Application_SingleObjective class members.
16 */
17
18#include <colin/application/SingleObjective.h>
19
20using std::cerr;
21using std::endl;
22using std::vector;
23
24using boost::bind;
25
26using utilib::Property;
27using utilib::Privileged_Property;
28using utilib::ReadOnly_Property;
29
30namespace colin {
31
32
33//--------------------------------------------------------------------
34// Application_SingleObjective Public member functions
35//--------------------------------------------------------------------
36
37/// Constructor
38Application_SingleObjective::Application_SingleObjective()
39   : _sense(Property::Bind<optimizationSense>(minimization)),
40     num_objectives(),
41     sense(_sense.set_readonly())
42{
43   Privileged_Property _num_objectives(Property::Bind<size_t>(1));
44   num_objectives = _num_objectives.set_readonly();
45
46   ObjectType type = ObjectType::get(this);
47   register_application_component(type);
48   properties.declare("num_objectives", _num_objectives, type);
49   properties.declare("sense", _sense, type);
50
51   print_signal.connect
52      (11, bind(&Application_SingleObjective::cb_print, this, _1));
53}
54
55
56/// Virtual destructor
57Application_SingleObjective::~Application_SingleObjective()
58{}
59
60
61/// Register a function evaluation computation
62DEFINE_REQUEST( Application_SingleObjective, F, f_info, objective function );
63
64
65void
66Application_SingleObjective::
67cb_print(std::ostream& os)
68{
69   os << "Number of objectives: " << num_objectives << std::endl;
70}
71
72} // namespace colin
Note: See TracBrowser for help on using the repository browser.