Class arena_cache

Inheritance Relationships

Base Types

Class Documentation

class arena_cache : public cosm::arena::repr::base_cache, public cosm::arena::metrics::caches::utilization_metrics, public cosm::arena::metrics::caches::location_metrics

A representation of an ACTUAL cache within the arena (as opposed to a robot’s representation of a cache, which may not be accuratef).

Arena caches:

  • Handle cache penalties

  • Can collect metrics about their usage

  • Have a light/beacon at ground level robots can see.

Public Functions

arena_cache(const arena_cache&) = delete
arena_cache(const base_cache::params &p, const rutils::color &light_color)
~arena_cache(void) override = default
inline void has_block_drop(void)

Set a flag indicating the cache has had a block drop this timestep.

inline void has_block_pickup(void)

Set a flag indicating the cache has had a block pickup this timestep.

inline ::argos::CLightEntity *light(void) const
inline virtual rmath::vector2z location(void) const override

Should return the discrete location of the cache.

inline virtual size_t n_blocks(void) const override

Get the # of blocks currently in the cache (independent of any calls to reset_metrics()).

arena_cache &operator=(const arena_cache&) = delete
inline void penalty_served(const rtypes::timestep &duration)

Increment the cumulative count of penalties served for both pickups and drops. Reset by reset_metrics().

void reset_metrics(void) override
inline virtual size_t total_block_drops(void) const override

Should return the # of blocks a given cache has had dropped in it this timestep.

This is currently has a max of 1, due to limitations/shortcuts taken with the block drop events.

inline virtual size_t total_block_pickups(void) const override

Should return the # of blocks a given cache has had picked up from it this timestep.

This currently has a max of 1, due to limitations/shortcuts taken with the block pickup events.