Femboy_GP/include/lilfbtf/fwddecl.h

74 lines
2.2 KiB
C
Raw Normal View History

2024-03-11 19:21:38 -04:00
#pragma once
/*
* Copyright (C) 2024 Brett Terpstra
*
* This program 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.
*
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef LILFBTF5_FWDDECL_H
#define LILFBTF5_FWDDECL_H
2024-03-12 16:53:27 -04:00
#include <blt/std/types.h>
2024-03-22 18:56:29 -04:00
#include <blt/std/any.h>
2024-03-12 16:53:27 -04:00
#include <functional>
#include "blt/std/ranges.h"
2024-03-12 17:16:32 -04:00
#include <string>
2024-03-12 16:53:27 -04:00
2024-03-11 19:21:38 -04:00
namespace fb
{
2024-03-22 18:56:29 -04:00
class func_t;
class tree_t;
class type_engine_t;
class gp_system_t;
class gp_population_t;
2024-03-11 19:21:38 -04:00
namespace detail
{
class node_t;
2024-03-22 11:52:24 -04:00
struct fitness_results
{
double fitness;
blt::size_t hits;
};
2024-03-22 18:56:29 -04:00
struct func_t_arguments
{
// reference to ourselves
func_t& self;
// list of arguments to use
blt::span<detail::node_t*> arguments;
// any extra information that the tree evaluator wants to provide to us, in the case of an image GP this is going to be the X and Y coords
blt::unsafe::buffer_any_t extra_args;
};
2024-03-11 19:21:38 -04:00
}
2024-03-13 12:16:25 -04:00
// no way we are going to have more than 4billion types or functions.
using type_id = blt::u32;
using function_id = blt::u32;
using arg_c_t = blt::size_t;
2024-03-22 18:56:29 -04:00
using func_t_call_t = std::function<void(const detail::func_t_arguments&)>;
2024-03-13 19:04:22 -04:00
using func_t_init_t = std::function<void(func_t&)>;
2024-03-22 11:52:24 -04:00
using fitness_eval_func_t = std::function<detail::fitness_results(detail::node_t*)>;
2024-03-23 02:57:01 -04:00
using individual_eval_func_t = std::function<void(tree_t&)>;
2024-03-12 17:16:32 -04:00
using function_name = const std::string&;
using type_name = const std::string&;
2024-03-11 19:21:38 -04:00
}
#endif //LILFBTF5_FWDDECL_H