activity-levels-env/active [ Methods ]

[ Top ] [ activity-levels-env ] [ Methods ]

DESCRIPTION

 Similar to the parent class method except that the level argument in that
 class is here supplied by the envelope and cycle-length.

ARGUMENTS

 - the activity-levels-env object

OPTIONAL ARGUMENTS

 - T or NIL to print debugging information.

RETURN VALUE

 T or NIL to indicate whether we're 'active' or not.

EXAMPLE

;;; we can see here that with a cycle-length of 10, calling active 31 times
;;; means we go through the envelope three times before arriving back at 0. 
(let ((ale (make-ale '(0 0 2 10 3 1) 10 2)))
  (loop repeat 31 collect (active ale t)))
->
current: 0 level: 0.0
current: 1 level: 1.6666667
current: 2 level: 3.3333335
current: 3 level: 5.0
current: 4 level: 6.666667
current: 5 level: 8.333333
current: 6 level: 10.0
current: 7 level: 7.0
current: 8 level: 4.0
current: 9 level: 1.0
current: 0 level: 0.0
current: 1 level: 1.6666667
current: 2 level: 3.3333335
current: 3 level: 5.0
current: 4 level: 6.666667
current: 5 level: 8.333333
current: 6 level: 10.0
current: 7 level: 7.0
current: 8 level: 4.0
current: 9 level: 1.0
current: 0 level: 0.0
current: 1 level: 1.6666667
current: 2 level: 3.3333335
current: 3 level: 5.0
current: 4 level: 6.666667
current: 5 level: 8.333333
current: 6 level: 10.0
current: 7 level: 7.0
current: 8 level: 4.0
current: 9 level: 1.0
current: 0 level: 0.0
(NIL NIL NIL NIL T T T T NIL NIL NIL NIL NIL T NIL T T T T NIL NIL NIL NIL NIL
 NIL T T T NIL NIL NIL)

SYNOPSIS

(defmethod active :around ((ale activity-levels-env) &optional print)

activity-levels-env/make-ale [ Functions ]

[ Top ] [ activity-levels-env ] [ Functions ]

DESCRIPTION

 For an overview of what this might be used for and how it's done in its
 basic form, see the description to make-al in the parent class
 'activity-levels'

ARGUMENTS

 None required.

OPTIONAL ARGUMENTS

 - the envelope in x y form. y values should range from 0 to 10, as with the
   level argument to an 'active' call in the parent class. x range can be
   any arbitrary value but start with 0 to get full-range results.
 - the cycle length: the envelope repeats after a specified cycle length, so
   that no matter how many times you call 'active' you always get results.
 - start-at (default NIL): which of the three 10-element lists in the parent
   class to start with (reset to).  Should be 0, 1, or 2, though if NIL will
   default to 0.

RETURN VALUE

 The activities-level-env object.

SYNOPSIS

(defun make-ale (&optional (env '(0 5 100 5)) (cycle-length 101) start-at)

named-object/activity-levels-env [ Classes ]

[ Top ] [ named-object ] [ Classes ]

NAME

 activity-levels

 File:             activity-levels-env.lsp

 Class Hierarchy:  named-object -> activity-levels -> activity-levels-env

 Version:          1.0.12

 Project:          slippery chicken (algorithmic composition)

 Purpose:          An extension of the activity-levels class to incorporate
                   a restarting envelope which is used to determine the 
                   current 'level' argument for a call to the active method. 

 Author:           Michael Edwards: m@michael-edwards.org

 Creation date:    30th June 2015

 $$ Last modified:  19:28:37 Thu Sep 24 2020 CEST

 SVN ID: $Id: activity-levels.lsp 5048 2014-10-20 17:10:38Z medward2 $