Porytiles
Loading...
Searching...
No Matches
packing_metrics.hpp
Go to the documentation of this file.
1#pragma once
2
43#include <cstddef>
44#include <map>
45#include <vector>
46
50
51namespace porytiles {
52
76[[nodiscard]] std::map<std::size_t, std::size_t>
77build_global_multiplicity_map(const std::vector<PackableTile> &tiles, const std::vector<PackableTile> &hints);
78
107[[nodiscard]] double
108compute_average_multiplicity(const std::vector<PackableTile> &tiles, const std::vector<PackableTile> &hints);
109
133[[nodiscard]] std::map<std::size_t, std::size_t> build_palette_local_multiplicity(
134 const PackedPalette &palette, const std::map<PackableTile::Id, ColorSet> &tile_colors_map);
135
161[[nodiscard]] double compute_weighted_cost_in_palette(
162 const ColorSet &tile_colors,
163 const PackedPalette &palette,
164 const std::map<PackableTile::Id, ColorSet> &tile_colors_map);
165
190[[nodiscard]] double
191compute_palette_local_efficiency(const ColorSet &tile_colors, const std::map<std::size_t, std::size_t> &local_mult);
192
208[[nodiscard]] double compute_weighted_cost_in_palette_fast(const ColorSet &tile_colors, const PackedPalette &palette);
209
225[[nodiscard]] double compute_palette_local_efficiency_fast(const ColorSet &tile_colors, const PackedPalette &palette);
226
227} // namespace porytiles
double compute_palette_local_efficiency(const ColorSet &tile_colors, const std::map< std::size_t, std::size_t > &local_mult)
Computes the palette-local efficiency of a tile within its palette.
double compute_weighted_cost_in_palette_fast(const ColorSet &tile_colors, const PackedPalette &palette)
Computes the weighted cost of placing a tile in a palette using cached counts.
double compute_weighted_cost_in_palette(const ColorSet &tile_colors, const PackedPalette &palette, const std::map< PackableTile::Id, ColorSet > &tile_colors_map)
Computes the weighted cost of placing a tile in a specific palette.
std::map< std::size_t, std::size_t > build_global_multiplicity_map(const std::vector< PackableTile > &tiles, const std::vector< PackableTile > &hints)
Builds a GLOBAL multiplicity map from all input tiles.
std::map< std::size_t, std::size_t > build_palette_local_multiplicity(const PackedPalette &palette, const std::map< PackableTile::Id, ColorSet > &tile_colors_map)
Builds a PALETTE-LOCAL multiplicity map for a specific palette.
double compute_average_multiplicity(const std::vector< PackableTile > &tiles, const std::vector< PackableTile > &hints)
Computes the average multiplicity of the input tiles (problem difficulty metric).
double compute_palette_local_efficiency_fast(const ColorSet &tile_colors, const PackedPalette &palette)
Computes the palette-local efficiency of a tile using cached counts.