Skip to content

Commit

Permalink
Change name -> id
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Oct 4, 2024
1 parent 4a0ec5e commit ecd1e47
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class Constraint
{
public:
Constraint(std::string name, Expression expression):
name_(std::move(name)),
id_(std::move(name)),
expression_(std::move(expression))
{
}

const std::string& Id() const
{
return name_;
return id_;
}

Expression expression() const
Expand All @@ -49,7 +49,7 @@ class Constraint
}

private:
std::string name_;
std::string id_;
Expression expression_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class Parameter
YES = true
};

explicit Parameter(std::string name,
explicit Parameter(std::string id,
ValueType type,
TimeDependent timeDependent,
ScenarioDependent scenarioDependent):
name_(std::move(name)),
id_(std::move(id)),
type_(type),
timeDependent_(timeDependent),
scenarioDependent_(scenarioDependent)
Expand All @@ -65,7 +65,7 @@ class Parameter

const std::string& Id() const
{
return name_;
return id_;
}

ValueType Type() const
Expand All @@ -84,7 +84,7 @@ class Parameter
}

private:
std::string name_;
std::string id_;
ValueType type_;
TimeDependent timeDependent_ = TimeDependent::YES; // optional at construction
ScenarioDependent scenarioDependent_ = ScenarioDependent::YES; // optional at construction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ namespace Antares::Solver::ObjectModel
class Port
{
public:
const std::string& Name() const
const std::string& Id() const
{
return name_;
return id_;
}

PortType Type() const
Expand All @@ -41,7 +41,7 @@ class Port
}

private:
std::string name_;
std::string id_;
PortType type_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ namespace Antares::Solver::ObjectModel
class PortField
{
public:
explicit PortField(const std::string& name):
name(name)
explicit PortField(const std::string& id):
id_(id)
{
}

const std::string& Id() const
{
return name;
return id_;
}

private:
std::string name;
std::string id_;
};

} // namespace Antares::Solver::ObjectModel
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace Antares::Solver::ObjectModel
class Variable
{
public:
Variable(std::string name, Expression lower_bound, Expression upper_bound, ValueType type):
name_(std::move(name)),
Variable(std::string id, Expression lower_bound, Expression upper_bound, ValueType type):
id_(std::move(id)),
type_(type),
lowerBound_(lower_bound),
upperBound_(upper_bound)
Expand All @@ -43,7 +43,7 @@ class Variable

const std::string& Id() const
{
return name_;
return id_;
}

ValueType Type() const
Expand All @@ -62,7 +62,7 @@ class Variable
}

private:
std::string name_;
std::string id_;
ValueType type_;
Expression lowerBound_;
Expression upperBound_;
Expand Down
2 changes: 1 addition & 1 deletion src/solver/libModelObject/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ModelBuilder& ModelBuilder::withPorts(std::vector<Port>&& ports)
ports.end(),
std::inserter(model_.ports_, model_.ports_.end()),
[](/*Non const to prevent copy*/ Port& port)
{ return std::make_pair(port.Name(), std::move(port)); });
{ return std::make_pair(port.Id(), std::move(port)); });
return *this;
}

Expand Down

0 comments on commit ecd1e47

Please sign in to comment.