Skip to content

Commit

Permalink
some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Nov 18, 2024
1 parent c79b38f commit be14a4c
Show file tree
Hide file tree
Showing 36 changed files with 435 additions and 463 deletions.
5 changes: 2 additions & 3 deletions benchmarks/construct_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

#include <benchmark/benchmark.h>
#include <iostream>
#include <loki/details/pddl/factories.hpp>
#include <loki/details/utils/memory.hpp>
#include <loki/loki.hpp>
#include <random>

namespace loki::benchmarks
Expand All @@ -34,7 +33,7 @@ static void BM_ConstructAtoms(benchmark::State& state)

for (auto _ : state)
{
auto factories = loki::PDDLFactories();
auto factories = loki::PDDLRepositories();

auto atoms = create_atoms(num_objects, num_predicates, factories);
benchmark::DoNotOptimize(atoms);
Expand Down
7 changes: 3 additions & 4 deletions benchmarks/iterate_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

#include <benchmark/benchmark.h>
#include <iostream>
#include <loki/details/pddl/factories.hpp>
#include <loki/details/utils/memory.hpp>
#include <loki/loki.hpp>
#include <random>

namespace loki::benchmarks
Expand Down Expand Up @@ -57,7 +56,7 @@ static void BM_IterateAtoms(benchmark::State& state)
const size_t num_predicates = 100;
// Choose num_objects sufficiently large, we cast to size_t to stay slightly below to fit into the cache
const size_t num_objects = static_cast<size_t>(sqrt(num_atoms / num_predicates));
auto factories = loki::PDDLFactories();
auto factories = loki::PDDLRepositories();
auto atoms = create_atoms(num_objects, num_predicates, factories);
benchmark::DoNotOptimize(atoms);

Expand All @@ -78,7 +77,7 @@ static void BM_RandomlyIterateAtoms(benchmark::State& state)
const size_t num_atoms = state.range(0);
const size_t num_predicates = 100;
const size_t num_objects = static_cast<size_t>(sqrt(num_atoms / num_predicates));
auto factories = loki::PDDLFactories();
auto factories = loki::PDDLRepositories();
auto atoms = create_atoms(num_objects, num_predicates, factories);
benchmark::DoNotOptimize(atoms);

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace loki::benchmarks
{

loki::AtomList create_atoms(size_t num_objects, size_t num_predicates, loki::PDDLFactories& factories)
loki::AtomList create_atoms(size_t num_objects, size_t num_predicates, loki::PDDLRepositories& factories)
{
// Create num_objects-many objects with name object_1,...,object_<num_objects>
auto objects = loki::ObjectList();
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
#ifndef LOKI_BENCHMARKS_UTILS_HPP_
#define LOKI_BENCHMARKS_UTILS_HPP_

#include <loki/details/pddl/factories.hpp>
#include <loki/details/utils/memory.hpp>
#include <loki/loki.hpp>

namespace loki::benchmarks
{

extern loki::AtomList create_atoms(size_t num_objects, size_t num_predicates, PDDLFactories& factories);
extern loki::AtomList create_atoms(size_t num_objects, size_t num_predicates, PDDLRepositories& factories);
}

#endif
4 changes: 2 additions & 2 deletions include/loki/details/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DomainParser
// We need to keep the source in memory for error reporting.
std::string m_source;

PDDLFactories m_factories;
PDDLRepositories m_repositories;

// The matched positions in the input PDDL file.
std::unique_ptr<PDDLPositionCache> m_position_cache;
Expand All @@ -52,7 +52,7 @@ class DomainParser
DomainParser& operator=(DomainParser&& other) = default;

/// @brief Get factories to create additional PDDL objects.
PDDLFactories& get_factories();
PDDLRepositories& get_factories();

/// @brief Get position caches to be able to reference back to the input PDDL file.
const PDDLPositionCache& get_position_cache() const;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ActionImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -35,7 +35,7 @@ class AtomImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -37,7 +37,7 @@ class AxiomImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -36,7 +36,7 @@ class ConditionLiteralImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -60,7 +60,7 @@ class ConditionAndImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -84,7 +84,7 @@ class ConditionOrImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -108,7 +108,7 @@ class ConditionNotImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -133,7 +133,7 @@ class ConditionImplyImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -159,7 +159,7 @@ class ConditionExistsImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -185,7 +185,7 @@ class ConditionForallImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand Down
6 changes: 3 additions & 3 deletions include/loki/details/pddl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_CONTEXT_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_CONTEXT_HPP_

#include "loki/details/pddl/factories.hpp"
#include "loki/details/pddl/position.hpp"
#include "loki/details/pddl/reference.hpp"
#include "loki/details/pddl/repositories.hpp"
#include "loki/details/pddl/scope.hpp"

namespace loki
Expand All @@ -29,7 +29,7 @@ namespace loki
struct Context
{
// For the unique construction of PDDL objects
PDDLFactories& factories;
PDDLRepositories& factories;
// For storing the positions in the input PDDL file
PDDLPositionCache& positions;
// For referencing to existing bindings
Expand All @@ -45,7 +45,7 @@ struct Context
// For convenience, to avoid an additional parameter during semantic parsing
Requirements requirements;

Context(PDDLFactories& factories_, PDDLPositionCache& positions_, ScopeStack& scopes_, bool strict_ = false, bool quiet_ = true) :
Context(PDDLRepositories& factories_, PDDLPositionCache& positions_, ScopeStack& scopes_, bool strict_ = false, bool quiet_ = true) :
factories(factories_),
positions(positions_),
scopes(scopes_),
Expand Down
5 changes: 3 additions & 2 deletions include/loki/details/pddl/declarations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using PDDLElement = const T*;
*/

template<typename HolderType, typename Hash, typename EqualTo>
class UniqueFactory;
class SegmentedRepository;

/**
* Domain
Expand Down Expand Up @@ -117,7 +117,8 @@ class EffectCompositeWhenImpl;
using EffectCompositeWhen = const EffectCompositeWhenImpl*;
class EffectCompositeOneofImpl;
using EffectCompositeOneof = const EffectCompositeOneofImpl*;
using EffectImpl = std::variant<EffectLiteralImpl, EffectAndImpl, EffectNumericImpl, EffectCompositeForallImpl, EffectCompositeWhenImpl, EffectCompositeOneofImpl>;
using EffectImpl =
std::variant<EffectLiteralImpl, EffectAndImpl, EffectNumericImpl, EffectCompositeForallImpl, EffectCompositeWhenImpl, EffectCompositeOneofImpl>;
using Effect = const EffectImpl*;
using EffectList = std::vector<Effect>;

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 @@ -54,7 +54,7 @@ class DomainImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand Down
12 changes: 6 additions & 6 deletions include/loki/details/pddl/effects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class EffectLiteralImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -71,7 +71,7 @@ class EffectAndImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -97,7 +97,7 @@ class EffectNumericImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -124,7 +124,7 @@ class EffectCompositeForallImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -150,7 +150,7 @@ class EffectCompositeWhenImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -174,7 +174,7 @@ class EffectCompositeOneofImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -35,7 +35,7 @@ class FunctionImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -56,7 +56,7 @@ class FunctionExpressionNumberImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand Down Expand Up @@ -85,7 +85,7 @@ class FunctionExpressionBinaryOperatorImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -112,7 +112,7 @@ class FunctionExpressionMultiOperatorImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -137,7 +137,7 @@ class FunctionExpressionMinusImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand All @@ -161,7 +161,7 @@ class FunctionExpressionFunctionImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -36,7 +36,7 @@ class FunctionSkeletonImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -35,7 +35,7 @@ class LiteralImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -44,7 +44,7 @@ class OptimizationMetricImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -33,7 +33,7 @@ class NumericFluentImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

NumericFluentImpl(size_t index, Function function, double number);

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 @@ -35,7 +35,7 @@ class ObjectImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
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 @@ -36,7 +36,7 @@ class ParameterImpl

// Give access to the constructor.
template<typename HolderType, typename Hash, typename EqualTo>
friend class UniqueFactory;
friend class SegmentedRepository;

public:
// moveable but not copyable
Expand Down
Loading

0 comments on commit be14a4c

Please sign in to comment.