<commit_before>#ifndef MINIASCAPE_STEPPER
#define MINIASCAPE_STEPPER
#include "Space.hpp"
#include "zip_iterator.hpp"

namespace miniascape
{

template<typename T_traits>
class Stepper
{
  public:
    using traits_type = T_traits;
    using world_type  = typename traits_type::world_type;
    using state_type  = typename traits_type::state_type;
    using cell_type   = typename traits_type::cell_type;
    using rule_type   = typename traits_type::rule_type;

    static void step(Space<traits_type>& space);
};

template<typename T_traits>
void Stepper<T_traits>::step(Space<traits_type>& space)
{
    for(auto cell = make_zip(space.world().cbegin(),space.temp().begin());
            cell != make_zip(space.world().cend(),  space.temp().end()); ++cell)
        **get<1>(cell) = rule_type::step(**get<0>(cell));

    for(auto cell = make_zip(space.world().begin(), space.temp().begin());
            cell != make_zip(space.world().end(),   space.temp().end()); ++cell)
        (*get<0>(cell))->state = std::move(**get<1>(cell));

    return;
}


}
<commit_msg>change stepper::step retval and make rule_type::step non-static<commit_after>#ifndef MINIASCAPE_STEPPER
#define MINIASCAPE_STEPPER
#include "Space.hpp"
#include "Rule.hpp"
#include "zip_iterator.hpp"

namespace miniascape
{

template<typename T_traits>
class Stepper
{
  public:
    using traits_type = T_traits;
    using time_type   = typename traits_type::time_type;
    using state_type  = typename traits_type::state_type;
    using cell_type   = typename traits_type::cell_type;
    using rule_type   = RuleBase<traits_type>;
    using space_type  = Space<traits_type>;

    static time_type step(space_type& space, const rule_type& rule);
};

template<typename T_traits>
typename Stepper<T_traits>::time_type
Stepper<T_traits>::step(space_type& space, const rule_type& rule)
{
    for(auto cell = make_zip(space.world().cbegin(),space.temp().begin());
            cell != make_zip(space.world().cend(),  space.temp().end()); ++cell)
        **get<1>(cell) = rule.step(**get<0>(cell));

    for(auto cell = make_zip(space.world().begin(), space.temp().begin());
            cell != make_zip(space.world().end(),   space.temp().end()); ++cell)
        (*get<0>(cell))->state = std::move(**get<1>(cell));

    return rule.delta_t();
}

}

{'fraction_non_alphanumeric': 0.16095444685466379, 'fraction_numerical': 0.0034707158351409977, 'mean_word_length': 4.5299760191846525, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6773741', 'n_tokens_mistral': 797, 'n_tokens_neox': 764, 'n_words': 144}