21 #ifndef ophidian_BINS_H
22 #define ophidian_BINS_H
24 #include <vector_property.h>
25 #include <entity_system.h>
26 #include "../geometry/geometry.h"
32 using point = geometry::point<double>;
54 point position(entity_system::entity bin) {
55 return m_positions[m_system.
lookup(bin)];
58 point dimension(entity_system::entity bin) {
59 return m_dimensions[m_system.
lookup(bin)];
62 double movable_utilization(entity_system::entity bin) {
63 return m_movable_utilization[m_system.
lookup(bin)];
66 double fixed_utilization(entity_system::entity bin) {
67 return m_fixed_utilization[m_system.
lookup(bin)];
70 double free_space(entity_system::entity bin) {
71 return m_free_space[m_system.
lookup(bin)];
74 std::pair< std::vector<point>::const_iterator, std::vector<point>::const_iterator > positions()
const {
75 return std::make_pair(m_positions.
begin(), m_positions.
end());
78 std::pair< std::vector<point>::const_iterator, std::vector<point>::const_iterator > dimensions()
const {
79 return std::make_pair(m_dimensions.
begin(), m_dimensions.
end());
82 std::pair< std::vector<double>::const_iterator, std::vector<double>::const_iterator > movable_utilizations()
const {
83 return std::make_pair(m_movable_utilization.
begin(), m_movable_utilization.
end());
86 std::pair< std::vector<double>::const_iterator, std::vector<double>::const_iterator > fixed_utilizations()
const {
87 return std::make_pair(m_fixed_utilization.
begin(), m_fixed_utilization.
end());
90 std::pair< std::vector<double>::const_iterator, std::vector<double>::const_iterator > free_spaces()
const {
91 return std::make_pair(m_free_space.
begin(), m_free_space.
end());
94 void position(entity_system::entity bin, point position);
96 void dimension(entity_system::entity bin, point dimension);
98 void movable_utilization(entity_system::entity bin,
double movable_utilization);
100 void fixed_utilization(entity_system::entity bin,
double fixed_utilization);
102 void free_space(entity_system::entity bin,
double free_space);
108 #endif //ophidian_BINS_H
std::vector< T >::const_iterator begin() const
Begin iterator.
Definition: vector_property.h:137
std::vector< T >::const_iterator end() const
End iterator.
Definition: vector_property.h:146
entity_system class.
Definition: entity_system.h:40
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149
void register_property(property *property)
Registers property.
Definition: entity_system.cpp:61