-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparameter.h
79 lines (57 loc) · 2.2 KB
/
parameter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
parameter.h - description
-------------------
begin : ven ott 4 2002
copyright : (C) 2002 by Davide Patti
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef PARAMETER_H
#define PARAMETER_H
#define NOT_VALID -1
#include <iostream>
#include <vector>
using namespace std;
class Parameter {
public:
Parameter();
Parameter(const string& label,vector<int> possible_values,int default_val);
Parameter(int * possible_values, int default_val); // deprecated
~Parameter();
int get_val() const;
int get_size() const;
int get_default() const;
void set_val(int new_value);
void set_label(const string& label);
string get_label() const;
void set_to_default();
void set_to_first();
void set_to_last();
void set_random();
// added by [email protected]
// Randomly set one of the values contained in the subinterval from index pos_a to
// index pos_b
void set_random(int pos_a, int pos_b);
int get_pos(int value);
bool increase();
bool decrease();
vector<int> get_values(); // mau
vector<int> get_interval(int a, int b);
void set_values(vector<int> values,int default_val);
void set_values(Parameter parameter);
int get_first();
int get_last();
private:
vector<int> values; // vector of possible values
int current; // index of current value in the array of values
int default_value;
string label;
};
#endif