Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed May 7, 2024
1 parent 8d0c225 commit e086cfd
Show file tree
Hide file tree
Showing 43 changed files with 81 additions and 75 deletions.
2 changes: 1 addition & 1 deletion include/loki/details/pddl/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ActionImpl : public Base<ActionImpl>
std::optional<Condition> m_condition;
std::optional<Effect> m_effect;

ActionImpl(int identifier, std::string name, ParameterList parameters, std::optional<Condition> condition, std::optional<Effect> effect);
ActionImpl(size_t identifier, std::string name, ParameterList parameters, std::optional<Condition> condition, std::optional<Effect> effect);

// Give access to the constructor.
friend class PDDLFactory<ActionImpl, Hash<ActionImpl*>, EqualTo<ActionImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/atom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AtomImpl : public Base<AtomImpl>
Predicate m_predicate;
TermList m_terms;

AtomImpl(int identifier, Predicate predicate, TermList terms);
AtomImpl(size_t identifier, Predicate predicate, TermList terms);

// Give access to the constructor.
friend class PDDLFactory<AtomImpl, Hash<AtomImpl*>, EqualTo<AtomImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/axiom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AxiomImpl : public Base<AxiomImpl>
Literal m_literal;
Condition m_condition;

AxiomImpl(int identifier, ParameterList parameters, Literal literal, Condition condition);
AxiomImpl(size_t identifier, ParameterList parameters, Literal literal, Condition condition);

// Give access to the constructor.
friend class PDDLFactory<AxiomImpl, Hash<AxiomImpl*>, EqualTo<AxiomImpl*>>;
Expand Down
7 changes: 4 additions & 3 deletions include/loki/details/pddl/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "loki/details/utils/printer.hpp"

#include <algorithm>
#include <cstddef>
#include <sstream>
#include <vector>

Expand Down Expand Up @@ -53,9 +54,9 @@ template<typename Derived>
class Base
{
protected:
int m_identifier;
size_t m_identifier;

explicit Base(int identifier) : m_identifier(identifier) {}
explicit Base(size_t identifier) : m_identifier(identifier) {}
friend Derived;

public:
Expand Down Expand Up @@ -97,7 +98,7 @@ class Base
}

/// @brief Returns the identifier
int get_identifier() const { return m_identifier; }
size_t get_identifier() const { return m_identifier; }
};

}
Expand Down
14 changes: 7 additions & 7 deletions include/loki/details/pddl/conditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ConditionLiteralImpl : public Base<ConditionLiteralImpl>
private:
Literal m_literal;

ConditionLiteralImpl(int identifier, Literal literal);
ConditionLiteralImpl(size_t identifier, Literal literal);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -55,7 +55,7 @@ class ConditionAndImpl : public Base<ConditionAndImpl>
private:
ConditionList m_conditions;

ConditionAndImpl(int identifier, ConditionList conditions);
ConditionAndImpl(size_t identifier, ConditionList conditions);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -77,7 +77,7 @@ class ConditionOrImpl : public Base<ConditionOrImpl>
private:
ConditionList m_conditions;

ConditionOrImpl(int identifier, ConditionList conditions);
ConditionOrImpl(size_t identifier, ConditionList conditions);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -99,7 +99,7 @@ class ConditionNotImpl : public Base<ConditionNotImpl>
private:
Condition m_condition;

ConditionNotImpl(int identifier, Condition condition);
ConditionNotImpl(size_t identifier, Condition condition);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -122,7 +122,7 @@ class ConditionImplyImpl : public Base<ConditionImplyImpl>
Condition m_condition_left;
Condition m_condition_right;

ConditionImplyImpl(int identifier, Condition condition_left, Condition condition_right);
ConditionImplyImpl(size_t identifier, Condition condition_left, Condition condition_right);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -146,7 +146,7 @@ class ConditionExistsImpl : public Base<ConditionExistsImpl>
ParameterList m_parameters;
Condition m_condition;

ConditionExistsImpl(int identifier, ParameterList parameters, Condition condition);
ConditionExistsImpl(size_t identifier, ParameterList parameters, Condition condition);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand All @@ -170,7 +170,7 @@ class ConditionForallImpl : public Base<ConditionForallImpl>
ParameterList m_parameters;
Condition m_condition;

ConditionForallImpl(int identifier, ParameterList parameters, Condition condition);
ConditionForallImpl(size_t identifier, ParameterList parameters, Condition condition);

// Give access to the constructor.
friend class PDDLFactory<ConditionImpl, Hash<ConditionImpl*>, EqualTo<ConditionImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DomainImpl : public Base<DomainImpl>
ActionList m_actions;
AxiomList m_axioms;

DomainImpl(int identifier,
DomainImpl(size_t identifier,
std::string name,
Requirements requirements,
TypeList types,
Expand Down
10 changes: 5 additions & 5 deletions include/loki/details/pddl/effects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EffectLiteralImpl : public Base<EffectLiteralImpl>
private:
Literal m_literal;

EffectLiteralImpl(int identifier, Literal literal);
EffectLiteralImpl(size_t identifier, Literal literal);

// Give access to the constructor.
friend class PDDLFactory<EffectImpl, Hash<EffectImpl*>, EqualTo<EffectImpl*>>;
Expand All @@ -66,7 +66,7 @@ class EffectAndImpl : public Base<EffectAndImpl>
private:
EffectList m_effects;

EffectAndImpl(int identifier, EffectList effects);
EffectAndImpl(size_t identifier, EffectList effects);

// Give access to the constructor.
friend class loki::PDDLFactory<EffectImpl, loki::Hash<EffectImpl*>, loki::EqualTo<EffectImpl*>>;
Expand All @@ -90,7 +90,7 @@ class EffectNumericImpl : public Base<EffectNumericImpl>
Function m_function;
FunctionExpression m_function_expression;

EffectNumericImpl(int identifier, AssignOperatorEnum assign_operator, Function function, FunctionExpression function_expression);
EffectNumericImpl(size_t identifier, AssignOperatorEnum assign_operator, Function function, FunctionExpression function_expression);

// Give access to the constructor.
friend class loki::PDDLFactory<EffectImpl, loki::Hash<EffectImpl*>, loki::EqualTo<EffectImpl*>>;
Expand All @@ -115,7 +115,7 @@ class EffectConditionalForallImpl : public Base<EffectConditionalForallImpl>
ParameterList m_parameters;
Effect m_effect;

EffectConditionalForallImpl(int identifier, ParameterList parameters, Effect effect);
EffectConditionalForallImpl(size_t identifier, ParameterList parameters, Effect effect);

// Give access to the constructor.
friend class loki::PDDLFactory<EffectImpl, loki::Hash<EffectImpl*>, loki::EqualTo<EffectImpl*>>;
Expand All @@ -139,7 +139,7 @@ class EffectConditionalWhenImpl : public Base<EffectConditionalWhenImpl>
Condition m_condition;
Effect m_effect;

EffectConditionalWhenImpl(int identifier, Condition condition, Effect effect);
EffectConditionalWhenImpl(size_t identifier, Condition condition, Effect effect);

// Give access to the constructor.
friend class loki::PDDLFactory<EffectImpl, loki::Hash<EffectImpl*>, loki::EqualTo<EffectImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FunctionImpl : public Base<FunctionImpl>
FunctionSkeleton m_function_skeleton;
TermList m_terms;

FunctionImpl(int identifier, FunctionSkeleton function_skeleton, TermList terms);
FunctionImpl(size_t identifier, FunctionSkeleton function_skeleton, TermList terms);

// Give access to the constructor.
friend class PDDLFactory<FunctionImpl, Hash<FunctionImpl*>, EqualTo<FunctionImpl*>>;
Expand Down
10 changes: 5 additions & 5 deletions include/loki/details/pddl/function_expressions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FunctionExpressionNumberImpl : public Base<FunctionExpressionNumberImpl>
private:
double m_number;

FunctionExpressionNumberImpl(int identifier, double number);
FunctionExpressionNumberImpl(size_t identifier, double number);

// Give access to the constructor.
friend class PDDLFactory<FunctionExpressionImpl, Hash<FunctionExpressionImpl*>, EqualTo<FunctionExpressionImpl*>>;
Expand All @@ -76,7 +76,7 @@ class FunctionExpressionBinaryOperatorImpl : public Base<FunctionExpressionBinar
FunctionExpression m_left_function_expression;
FunctionExpression m_right_function_expression;

FunctionExpressionBinaryOperatorImpl(int identifier,
FunctionExpressionBinaryOperatorImpl(size_t identifier,
BinaryOperatorEnum binary_operator,
FunctionExpression left_function_expression,
FunctionExpression right_function_expression);
Expand Down Expand Up @@ -104,7 +104,7 @@ class FunctionExpressionMultiOperatorImpl : public Base<FunctionExpressionMultiO
MultiOperatorEnum m_multi_operator;
FunctionExpressionList m_function_expressions;

FunctionExpressionMultiOperatorImpl(int identifier, MultiOperatorEnum multi_operator, FunctionExpressionList function_expressions);
FunctionExpressionMultiOperatorImpl(size_t identifier, MultiOperatorEnum multi_operator, FunctionExpressionList function_expressions);

// Give access to the constructor.
friend class PDDLFactory<FunctionExpressionImpl, Hash<FunctionExpressionImpl*>, EqualTo<FunctionExpressionImpl*>>;
Expand All @@ -127,7 +127,7 @@ class FunctionExpressionMinusImpl : public Base<FunctionExpressionMinusImpl>
private:
FunctionExpression m_function_expression;

FunctionExpressionMinusImpl(int identifier, FunctionExpression function_expression);
FunctionExpressionMinusImpl(size_t identifier, FunctionExpression function_expression);

// Give access to the constructor.
friend class PDDLFactory<FunctionExpressionImpl, Hash<FunctionExpressionImpl*>, EqualTo<FunctionExpressionImpl*>>;
Expand All @@ -149,7 +149,7 @@ class FunctionExpressionFunctionImpl : public Base<FunctionExpressionFunctionImp
private:
Function m_function;

FunctionExpressionFunctionImpl(int identifier, Function function);
FunctionExpressionFunctionImpl(size_t identifier, Function function);

// Give access to the constructor.
friend class PDDLFactory<FunctionExpressionImpl, Hash<FunctionExpressionImpl*>, EqualTo<FunctionExpressionImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/function_skeleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FunctionSkeletonImpl : public Base<FunctionSkeletonImpl>
ParameterList m_parameters;
Type m_type;

FunctionSkeletonImpl(int identifier, std::string name, ParameterList parameters, Type type);
FunctionSkeletonImpl(size_t identifier, std::string name, ParameterList parameters, Type type);

// Give access to the constructor.
friend class PDDLFactory<FunctionSkeletonImpl, Hash<FunctionSkeletonImpl*>, EqualTo<FunctionSkeletonImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/literal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LiteralImpl : public Base<LiteralImpl>
bool m_is_negated;
Atom m_atom;

LiteralImpl(int identifier, bool is_negated, Atom atom);
LiteralImpl(size_t identifier, bool is_negated, Atom atom);

// Give access to the constructor.
friend class PDDLFactory<LiteralImpl, Hash<LiteralImpl*>, EqualTo<LiteralImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OptimizationMetricImpl : public Base<OptimizationMetricImpl>
OptimizationMetricEnum m_optimization_metric;
FunctionExpression m_function_expression;

OptimizationMetricImpl(int identifier, OptimizationMetricEnum optimization_metric, FunctionExpression function_expression);
OptimizationMetricImpl(size_t identifier, OptimizationMetricEnum optimization_metric, FunctionExpression function_expression);

// Give access to the constructor.
friend class PDDLFactory<OptimizationMetricImpl, Hash<OptimizationMetricImpl*>, EqualTo<OptimizationMetricImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/numeric_fluent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NumericFluentImpl : public Base<NumericFluentImpl>
// Give access to the constructor.
friend class PDDLFactory<NumericFluentImpl, Hash<NumericFluentImpl*>, EqualTo<NumericFluentImpl*>>;

NumericFluentImpl(int identifier, Function function, double number);
NumericFluentImpl(size_t identifier, Function function, double number);

/// @brief Test for semantic equivalence
bool is_structurally_equivalent_to_impl(const NumericFluentImpl& other) const;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ObjectImpl : public Base<ObjectImpl>
std::string m_name;
TypeList m_types;

ObjectImpl(int identifier, std::string name, TypeList types = {});
ObjectImpl(size_t identifier, std::string name, TypeList types = {});

// Give access to the constructor.
friend class PDDLFactory<ObjectImpl, Hash<ObjectImpl*>, EqualTo<ObjectImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ParameterImpl : public Base<ParameterImpl>
Variable m_variable;
TypeList m_types;

ParameterImpl(int identifier, Variable variable, TypeList types);
ParameterImpl(size_t identifier, Variable variable, TypeList types);

// Give access to the constructor.
friend class PDDLFactory<ParameterImpl, Hash<ParameterImpl*>, EqualTo<ParameterImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/predicate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PredicateImpl : public Base<PredicateImpl>
std::string m_name;
ParameterList m_parameters;

PredicateImpl(int identifier, std::string name, ParameterList parameters);
PredicateImpl(size_t identifier, std::string name, ParameterList parameters);

// Give access to the constructor.
friend class PDDLFactory<PredicateImpl, Hash<PredicateImpl*>, EqualTo<PredicateImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/problem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ProblemImpl : public Base<ProblemImpl>
std::optional<OptimizationMetric> m_optimization_metric;
AxiomList m_axioms;

ProblemImpl(int identifier,
ProblemImpl(size_t identifier,
Domain domain,
std::string name,
Requirements requirements,
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/requirements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class RequirementsImpl : public Base<RequirementsImpl>
private:
RequirementEnumSet m_requirements;

RequirementsImpl(int identifier, RequirementEnumSet requirements);
RequirementsImpl(size_t identifier, RequirementEnumSet requirements);

// Give access to the constructor.
friend class PDDLFactory<RequirementsImpl, Hash<RequirementsImpl*>, EqualTo<RequirementsImpl*>>;
Expand Down
4 changes: 2 additions & 2 deletions include/loki/details/pddl/term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TermObjectImpl : public Base<TermObjectImpl>
private:
Object m_object;

TermObjectImpl(int identifier, Object object);
TermObjectImpl(size_t identifier, Object object);

// Give access to the constructor.
friend class PDDLFactory<TermImpl, Hash<TermImpl*>, EqualTo<TermImpl*>>;
Expand All @@ -53,7 +53,7 @@ class TermVariableImpl : public Base<TermVariableImpl>
private:
Variable m_variable;

TermVariableImpl(int identifier, Variable variable);
TermVariableImpl(size_t identifier, Variable variable);

// Give access to the constructor.
friend class PDDLFactory<TermImpl, Hash<TermImpl*>, EqualTo<TermImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TypeImpl : public Base<TypeImpl>
std::string m_name;
TypeList m_bases;

TypeImpl(int identifier, std::string name, TypeList bases = {});
TypeImpl(size_t identifier, std::string name, TypeList bases = {});

// Give access to the constructor.
friend class PDDLFactory<TypeImpl, Hash<TypeImpl*>, EqualTo<TypeImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VariableImpl : public Base<VariableImpl>
private:
std::string m_name;

VariableImpl(int identifier, std::string name);
VariableImpl(size_t identifier, std::string name);

// Give access to the constructor.
friend class PDDLFactory<VariableImpl, Hash<VariableImpl*>, EqualTo<VariableImpl*>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/utils/garbage_collected_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GarbageCollectedFactory
std::lock_guard<std::mutex> hold(m_cache->mutex);

auto& t_cache = std::get<PerTypeCache<T>>(m_cache->data);
int identifier = m_cache->count;
size_t identifier = m_cache->count;
auto key = T(identifier, args...);
const auto [it, inserted] = t_cache.uniqueness.insert(key);
if (!inserted)
Expand Down
2 changes: 1 addition & 1 deletion src/pddl/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace loki
{
ActionImpl::ActionImpl(int identifier, std::string name, ParameterList parameters, std::optional<Condition> condition, std::optional<Effect> effect) :
ActionImpl::ActionImpl(size_t identifier, std::string name, ParameterList parameters, std::optional<Condition> condition, std::optional<Effect> effect) :
Base(identifier),
m_name(std::move(name)),
m_parameters(std::move(parameters)),
Expand Down
2 changes: 1 addition & 1 deletion src/pddl/atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace loki
{
AtomImpl::AtomImpl(int identifier, Predicate predicate, TermList terms) : Base(identifier), m_predicate(std::move(predicate)), m_terms(std::move(terms)) {}
AtomImpl::AtomImpl(size_t identifier, Predicate predicate, TermList terms) : Base(identifier), m_predicate(std::move(predicate)), m_terms(std::move(terms)) {}

bool AtomImpl::is_structurally_equivalent_to_impl(const AtomImpl& other) const { return (m_predicate == other.m_predicate) && (m_terms == other.m_terms); }

Expand Down
2 changes: 1 addition & 1 deletion src/pddl/axiom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace loki
{
AxiomImpl::AxiomImpl(int identifier, ParameterList parameters, Literal literal, Condition condition) :
AxiomImpl::AxiomImpl(size_t identifier, ParameterList parameters, Literal literal, Condition condition) :
Base(identifier),
m_parameters(std::move(parameters)),
m_literal(std::move(literal)),
Expand Down
Loading

0 comments on commit e086cfd

Please sign in to comment.