-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvariable.cpp
More file actions
45 lines (39 loc) · 1.76 KB
/
Copy pathvariable.cpp
File metadata and controls
45 lines (39 loc) · 1.76 KB
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
/*
* GHOST (General meta-Heuristic Optimization Solving Tool) is a C++ framework
* designed to help developers to model and implement optimization problem
* solving. It contains a meta-heuristic solver aiming to solve any kind of
* combinatorial and optimization real-time problems represented by a CSP/COP/EF-CSP/EF-COP.
*
* First developed to solve game-related optimization problems, GHOST can be used for
* any kind of applications where solving combinatorial and optimization problems. In
* particular, it had been designed to be able to solve not-too-complex problem instances
* within some milliseconds, making it very suitable for highly reactive or embedded systems.
* Please visit https://github.com/richoux/GHOST for further information.
*
* Copyright (C) 2014-2026 Florian Richoux
*
* This file is part of GHOST.
* GHOST 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 3 of the License, or
* (at your option) any later version.
* GHOST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with GHOST. If not, see http://www.gnu.org/licenses/.
*/
#include <limits>
#include <numeric>
#include "variable.hpp"
using ghost::Variable;
Variable::Variable( int id,
std::vector<int>* domain,
int index,
const std::string& name )
: _id( id ),
_name( name ),
_current_value( domain->at(index) ),
_domain( domain )
{ }