source: trunk/extremum_seeking/esc_nn/include/esc_nn/nn_esc_1d.h

Last change on this file was 18, checked in by wcaarls, 11 years ago

Updated extremum_seeking to revision 1177

File size: 1.7 KB
Line 
1/*
2 * nn_esc_1d.h
3 *
4 *  Created on: Jul 26, 2012
5 *      Author: Berk Calli
6 *      Organization: Delft Biorobotics Lab., Delft University of Technology
7 *              Contact info: b.calli@tudelft.nl, web: www.dbl.tudelft.nl
8 *
9 * Header file of the class for one dimensional neural network based extremum seeking control
10 *
11 * * References:
12 * - M. Teixeira and S. Zak, “Analog neural nonderivative optimizers,” IEEE Transactions on Neural Networks, vol. 9, pp. 629–638, 1998.
13 * - B. Calli, W. Caarls, P. Jonker and M. Wisse, "Comparison of Extremum Seeking Control Algorithms for Robotic Applications", IROS 2012.
14 */
15#
16
17#ifndef NN_ESC_1D_H_
18#define NN_ESC_1D_H_
19
20#include <vector>
21#include <string>
22#include "esc_common/esc.h"
23#include "stdio.h"
24class NNESC1D : public ESC {
25public:
26        enum { monitorSwitch, monitorPeak };
27
28protected:
29        double A_,M_,ddelta_,delta_,B_, mpd_init_, w_switch_old_, a_switch_old_,yr_,period_;
30        double min_peak_,vel_ref_,w_switch_,obj_val_cycle_init_;
31        double stoping_min_val_,vel_ref_old_;
32        int stopping_cycle_number_,nn_cycle_count_;
33        bool initialized_,min_peak_detect_init_;
34
35public:
36        NNESC1D();
37
38        NNESC1D(double A,double M, double B, double ddelta, double delta, double period, int stopping_cycle_number, double stoping_min_val);
39
40        void init(double A, double M, double B, double ddelta, double delta, double period, int stopping_cycle_number, double stoping_min_val);
41
42        std::vector<double> step(double obj_val);
43        inputType getInputType();
44        outputType getOutputType();
45        std::vector<double> monitor();
46        std::vector<std::string> monitorNames();
47protected:
48        double wSwitch(double e_minus);
49        double minPeakDetect(double e_minus);
50        double aSwitch(double e);
51        void reset();
52        bool isStoppingConditionsMet();
53
54};
55
56
57#endif /* NN_ESC_1D_H_ */
Note: See TracBrowser for help on using the repository browser.