AdaptiveLru

from panda3d.core import AdaptiveLru
class AdaptiveLru

Bases: Namable

A basic LRU-type algorithm, except that it is adaptive and attempts to avoid evicting pages that have been used more frequently (even if less recently) than other pages.

The interface is designed to be identical to that for SimpleLru, so that it may be used as a drop-in replacement.

Inheritance diagram

Inheritance diagram of AdaptiveLru

__init__(*args, **kwargs)
beginEpoch()

C++ Interface: begin_epoch(const AdaptiveLru self)

/**
  • Marks the end of the previous epoch and the beginning of the next one.

  • This will evict any objects that are pending eviction, and also update any

  • internal bookkeeping.

*/

begin_epoch()

C++ Interface: begin_epoch(const AdaptiveLru self)

/**
  • Marks the end of the previous epoch and the beginning of the next one.

  • This will evict any objects that are pending eviction, and also update any

  • internal bookkeeping.

*/

considerEvict()

C++ Interface: consider_evict(const AdaptiveLru self)

/**
  • Evicts a sequence of objects if the queue is full.

*/

consider_evict()

C++ Interface: consider_evict(const AdaptiveLru self)

/**
  • Evicts a sequence of objects if the queue is full.

*/

countActiveSize()

C++ Interface: count_active_size(AdaptiveLru self)

/**
  • Returns the total size of the pages that were enqueued since the last call

  • to begin_epoch().

*/

count_active_size()

C++ Interface: count_active_size(AdaptiveLru self)

/**
  • Returns the total size of the pages that were enqueued since the last call

  • to begin_epoch().

*/

evictTo()

C++ Interface: evict_to(const AdaptiveLru self, int target_size)

/**
  • Evicts a sequence of objects until the queue fits within the indicated

  • target size, regardless of its normal max size.

*/

evict_to()

C++ Interface: evict_to(const AdaptiveLru self, int target_size)

/**
  • Evicts a sequence of objects until the queue fits within the indicated

  • target size, regardless of its normal max size.

*/

getMaxSize()

C++ Interface: get_max_size(AdaptiveLru self)

/**
  • Returns the max size of all objects that are allowed to be active on the

  • LRU.

*/

getMaxUpdatesPerFrame()

C++ Interface: get_max_updates_per_frame(AdaptiveLru self)

/**
  • Returns the maximum number of pages the AdaptiveLru will update each frame.

*/

getTotalSize()

C++ Interface: get_total_size(AdaptiveLru self)

/**
  • Returns the total size of all objects currently active on the LRU.

*/

getWeight()

C++ Interface: get_weight(AdaptiveLru self)

/**
  • Returns the weight value used to compute the exponential moving average.

*/

get_max_size()

C++ Interface: get_max_size(AdaptiveLru self)

/**
  • Returns the max size of all objects that are allowed to be active on the

  • LRU.

*/

get_max_updates_per_frame()

C++ Interface: get_max_updates_per_frame(AdaptiveLru self)

/**
  • Returns the maximum number of pages the AdaptiveLru will update each frame.

*/

get_total_size()

C++ Interface: get_total_size(AdaptiveLru self)

/**
  • Returns the total size of all objects currently active on the LRU.

*/

get_weight()

C++ Interface: get_weight(AdaptiveLru self)

/**
  • Returns the weight value used to compute the exponential moving average.

*/

output()

C++ Interface: output(AdaptiveLru self, ostream out)

/**

*/

setMaxSize()

C++ Interface: set_max_size(const AdaptiveLru self, int max_size)

/**
  • Changes the max size of all objects that are allowed to be active on the

  • LRU.

  • If the size is (size_t)-1, there is no limit.

*/

setMaxUpdatesPerFrame()

C++ Interface: set_max_updates_per_frame(const AdaptiveLru self, int max_updates_per_frame)

/**
  • Specifies the maximum number of pages the AdaptiveLru will update each

  • frame. This is a performance optimization: keeping this number low limits

  • the impact of the AdaptiveLru’s adaptive algorithm.

*/

setWeight()

C++ Interface: set_weight(const AdaptiveLru self, float weight)

// The following methods are specific to AdaptiveLru, and do not exist in // the SimpleLru implementation. In most cases, the defaults will be // sufficient, so you do not need to mess with them.

/**
  • Specifies the weight value used to compute the exponential moving average.

*/

set_max_size()

C++ Interface: set_max_size(const AdaptiveLru self, int max_size)

/**
  • Changes the max size of all objects that are allowed to be active on the

  • LRU.

  • If the size is (size_t)-1, there is no limit.

*/

set_max_updates_per_frame()

C++ Interface: set_max_updates_per_frame(const AdaptiveLru self, int max_updates_per_frame)

/**
  • Specifies the maximum number of pages the AdaptiveLru will update each

  • frame. This is a performance optimization: keeping this number low limits

  • the impact of the AdaptiveLru’s adaptive algorithm.

*/

set_weight()

C++ Interface: set_weight(const AdaptiveLru self, float weight)

// The following methods are specific to AdaptiveLru, and do not exist in // the SimpleLru implementation. In most cases, the defaults will be // sufficient, so you do not need to mess with them.

/**
  • Specifies the weight value used to compute the exponential moving average.

*/

validate()

C++ Interface: validate(const AdaptiveLru self)

/**
  • Checks that the LRU is internally self-consistent. Returns true if

  • successful, false if there is some problem.

*/

write()

C++ Interface: write(AdaptiveLru self, ostream out, int indent_level)

/**

*/