algorithmic_base.cpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00033 #include <acado/user_interaction/algorithmic_base.hpp>
00034 
00035 
00036 BEGIN_NAMESPACE_ACADO
00037 
00038 
00039 //
00040 // PUBLIC MEMBER FUNCTIONS:
00041 //
00042 
00043 
00044 AlgorithmicBase::AlgorithmicBase( )
00045 {
00046         userInteraction = new UserInteraction;
00047         useModuleStandalone = BT_TRUE;
00048         
00049         outputLoggingIdx = -1;
00050 }
00051 
00052 
00053 AlgorithmicBase::AlgorithmicBase(       UserInteraction* _userInteraction
00054                                                                         )
00055 {
00056         if ( _userInteraction == 0 )
00057         {
00058                 userInteraction = new UserInteraction;
00059                 useModuleStandalone = BT_TRUE;
00060         }
00061         else
00062         {
00063                 userInteraction = _userInteraction;
00064                 useModuleStandalone = BT_FALSE;
00065         }
00066         
00067         outputLoggingIdx = -1;
00068 }
00069 
00070 
00071 AlgorithmicBase::AlgorithmicBase( const AlgorithmicBase& rhs )
00072 {
00073         if ( rhs.useModuleStandalone == BT_TRUE )
00074         {
00075                 userInteraction = new UserInteraction( *(rhs.userInteraction) );
00076                 useModuleStandalone = BT_TRUE;
00077         }
00078         else
00079         {
00080                 userInteraction = rhs.userInteraction;
00081                 useModuleStandalone = BT_FALSE;
00082         }
00083         
00084         outputLoggingIdx = rhs.outputLoggingIdx;
00085 }
00086 
00087 
00088 AlgorithmicBase::~AlgorithmicBase( )
00089 {
00090         if ( useModuleStandalone == BT_TRUE )
00091         {
00092                 if ( userInteraction != 0 )
00093                   delete userInteraction;
00094         }
00095 }
00096 
00097 
00098 AlgorithmicBase& AlgorithmicBase::operator=( const AlgorithmicBase& rhs )
00099 {
00100         if ( this != &rhs )
00101         {
00102                 if ( rhs.useModuleStandalone == BT_TRUE )
00103                 {
00104                         userInteraction = new UserInteraction( *(rhs.userInteraction) );
00105                         useModuleStandalone = BT_TRUE;
00106                 }
00107                 else
00108                 {
00109                         userInteraction = rhs.userInteraction;
00110                         useModuleStandalone = BT_FALSE;
00111                 }
00112                 
00113                 outputLoggingIdx = rhs.outputLoggingIdx;
00114         }
00115 
00116         return *this;
00117 }
00118 
00119 
00120 returnValue AlgorithmicBase::addOptionsList( )
00121 {
00122         return userInteraction->addOptionsList( );
00123 }
00124 
00125 
00126 returnValue AlgorithmicBase::set(       OptionsName name,
00127                                                                         int value
00128                                                                         )
00129 {
00130         return userInteraction->set( name,value );
00131 }
00132 
00133 
00134 returnValue AlgorithmicBase::set(       OptionsName name,
00135                                                                         double value
00136                                                                         )
00137 {       
00138         return userInteraction->set( name,value );
00139 }
00140 
00141 returnValue AlgorithmicBase::set(       OptionsName name,
00142                                                                         const std::string& value
00143                                                                         )
00144 {
00145         return userInteraction->set( name,value );
00146 }
00147 
00148 
00149 returnValue AlgorithmicBase::set(       uint idx,
00150                                                                         OptionsName name,
00151                                                                         int value
00152                                                                         )
00153 {
00154         return userInteraction->set( idx,name,value );
00155 }
00156 
00157 
00158 returnValue AlgorithmicBase::set(       uint idx,
00159                                                                         OptionsName name,
00160                                                                         double value
00161                                                                         )
00162 {       
00163         return userInteraction->set( idx,name,value );
00164 }
00165 
00166 
00167 returnValue AlgorithmicBase::setOptions( const Options &arg )
00168 {
00169         return userInteraction->setOptions( arg );
00170 }
00171 
00172 
00173 returnValue AlgorithmicBase::setOptions(        uint idx,
00174                                                                                         const Options &arg
00175                                                                                         )
00176 {
00177         return userInteraction->setOptions( idx,arg );
00178 }
00179 
00180 
00181 Options AlgorithmicBase::getOptions(    uint idx
00182                                                                                 ) const
00183 {
00184         return userInteraction->getOptions( idx );
00185 }
00186 
00187 
00188 //
00189 // PROTECTED MEMBER FUNCTIONS:
00190 //
00191 
00192 
00193 
00194 
00195 CLOSE_NAMESPACE_ACADO
00196 
00197 
00198 /*
00199  *      end of file
00200  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:36:41