Lisp Educational Network Simulator (LENS)
Table of Contents
- 1 Summary
- 2 Using LENS
- 3 Internal Package:
lens
- 3.1 Description
- 3.2 Class Hierarchy
- 3.3 External Symbols
- 3.3.1 External Classes
- External Class:
channel
- External Class:
component
- External Class:
compound-module
- External Class:
compound-module-class
- External Class:
delay-channel
- External Class:
entity-with-signals
- External Class:
gate
- External Class:
gate-slot
- External Class:
histogram
- External Class:
history-buffer
- External Class:
ideal-channel
- External Class:
indexed-count-recorder
- External Class:
last-value
- External Class:
mean
- External Class:
message
- External Class:
module
- External Class:
module-class
- External Class:
mt-random-state
- External Class:
named-object
- External Class:
network
- External Class:
owned-object
- External Class:
packet
- External Class:
packet-buffer
- External Class:
parameter-class
- External Class:
parameter-object
- External Class:
simulation
- External Class:
simulation-condition
- External Class:
stddev
- External Class:
sum
- External Class:
timeavg
- External Class:
timer-message
- External Class:
transmission-channel
- External Class:
unknown-message
- External Class:
with-timers
- External Class:
- 3.3.2 External Structures
- 3.3.3 External Types
- 3.3.4 External Constants
- 3.3.5 External Global Variables
- 3.3.6 External Macros
- 3.3.7 External Functions
- External Function:
<=
- External Function:
<=
- External Function:
arrival-time
- External Function:
arrived
- External Function:
average-queue-time
- External Function:
bernoulli
- External Function:
beta
- External Function:
binomial
- External Function:
bit-error-p
- External Function:
bit-length
- External Function:
buffer-size
- External Function:
buffer-size-bytes
- External Function:
build-connections
- External Function:
build-gates
- External Function:
build-inside
- External Function:
build-submodules
- External Function:
busy-p
- External Function:
byte-length
- External Function:
calculate-duration
- External Function:
cancel
- External Function:
cancel-timer
- External Function:
cauchy
- External Function:
channel
- External Function:
chi-square
- External Function:
configuration
- External Function:
configure
- External Function:
connect
- External Function:
connected-outside-p
- External Function:
connected-p
- External Function:
control-info
- External Function:
coord*
- External Function:
coord+
- External Function:
coord-
- External Function:
coord-op
- External Function:
coord-x
- External Function:
coord-y
- External Function:
coord-z
- External Function:
copy-slots
- External Function:
cpu-time-limit
- External Function:
creation-time
- External Function:
cumulative-density-function
- External Function:
decapsulate
- External Function:
define-result-recorder
- External Function:
delay
- External Function:
deliver
- External Function:
deliver-on-reception-start-p
- External Function:
dequeue
- External Function:
detailed-info
- External Function:
disabled-p
- External Function:
disconnect
- External Function:
distance
- External Function:
do-histogram
- External Function:
duplicate
- External Function:
duplicate-p
- External Function:
emit
- External Function:
empty-p
- External Function:
encapsulate
- External Function:
end-module
- External Function:
enqueue
- External Function:
erlang-k
- External Function:
exponential
- External Function:
find-object
- External Function:
finish
- External Function:
for-each-channel
- External Function:
for-each-child
- External Function:
for-each-gate
- External Function:
for-each-submodule
- External Function:
format-from-type
- External Function:
from-gate
- External Function:
from-module
- External Function:
full-name
- External Function:
full-path
- External Function:
gamma-d
- External Function:
gate
- External Function:
gate-direction
- External Function:
gate-extend
- External Function:
gate-size
- External Function:
gate-type
- External Function:
geometric
- External Function:
handle-message
- External Function:
handle-timer
- External Function:
has-listeners
- External Function:
index
- External Function:
info
- External Function:
initialize
- External Function:
initialized-p
- External Function:
input
- External Function:
intuniform
- External Function:
latency
- External Function:
listeners
- External Function:
lognormal
- External Function:
make-coord
- External Function:
may-have-listeners
- External Function:
message
- External Function:
message-sent-signal-value-message
- External Function:
message-sent-signal-value-result
- External Function:
message-sent-signal-value-timestamp
- External Function:
module
- External Function:
name
- External Function:
negbinomial
- External Function:
network
- External Function:
nominal-datarate
- External Function:
normal
- External Function:
output
- External Function:
owner
- External Function:
parent-module
- External Function:
pareto-shifted
- External Function:
path-end-gate
- External Function:
path-start-gate
- External Function:
peek
- External Function:
poisson
- External Function:
probability-density-function
- External Function:
process-message
- External Function:
property-union
- External Function:
queue
- External Function:
rand
- External Function:
range-getf
- External Function:
range-list-p
- External Function:
read-configuration
- External Function:
read-parameter
- External Function:
receive-signal
- External Function:
record
- External Function:
register-signal
- External Function:
reinitialise-slots
- External Function:
repair-signal-flags
- External Function:
report
- External Function:
rng-map
- External Function:
root-event
- External Function:
run-simulations
- External Function:
schedule
- External Function:
schedule-at
- External Function:
scheduled-p
- External Function:
sec
- External Function:
seed
- External Function:
self-message-p
- External Function:
send
- External Function:
send-direct
- External Function:
sent-time
- External Function:
serialise
- External Function:
set-slots
- External Function:
set-timer
- External Function:
signal-id
- External Function:
sim-time-limit
- External Function:
simulation-time
- External Function:
size
- External Function:
stop
- External Function:
student-t
- External Function:
submodule
- External Function:
subscribe
- External Function:
subscribed-p
- External Function:
timer
- External Function:
timestamp
- External Function:
timestamped-time
- External Function:
timestamped-value
- External Function:
title
- External Function:
to-gate
- External Function:
to-module
- External Function:
transmission-channel
- External Function:
transmission-finish-time
- External Function:
triang
- External Function:
truncnormal
- External Function:
uniform
- External Function:
unsubscribe
- External Function:
urandom
- External Function:
weibull
- External Function:
- 3.3.1 External Classes
- 3.4 Ambiguous Symbols
- 3.5 Index
- 4 Colophon
- 5 Internal Package:
lens.wsn
- 5.1 Description
- 5.2 Class Hierarchy
- 5.3 External Symbols
- 5.3.1 External Classes
- Class:
app-net-control-info
- Class:
application
- Class:
application-packet
- Class:
bypass-mac
- Class:
bypass-routing
- Class:
comms-module
- Class:
communications
- Class:
connectivity-map
- Class:
direct-node-physical-process
- Class:
leach-routing
- Class:
line-mobility
- Class:
mac
- Class:
mac-control-command
- Class:
mac-control-message
- Class:
mac-packet
- Class:
mac-radio-control-info
- Class:
mac802.15.4
- Class:
mobility
- Class:
multipath-rings-routing
- Class:
net-mac-control-info
- External Class:
network
- External Class:
network
- Class:
network-control-command
- Class:
network-control-message
- Class:
no-mobility
- Class:
node
- Class:
physical-process
- Class:
radio
- Class:
radio-control-command
- Class:
radio-control-message
- Class:
resources
- Class:
routing
- Class:
routing-packet
- Class:
scenario-physical-process
- Class:
simple-aggregation
- Class:
throughput-test
- Class:
tmac
- Class:
tuneable-mac
- Class:
value-propagation
- Class:
value-reporting
- Class:
wireless-channel
- Class:
wsn
- Class:
wsn-module
- Class:
wsn-packet
- Class:
- 5.3.2 External Structures
- 5.3.3 External Types
- 5.3.4 External Constants
- 5.3.5 External Global Variables
- 5.3.6 External Functions
- Function:
applicationid
- Function:
argument
- Function:
attempt-tx
- Function:
bits-per-symbol
- Internal Function:
buffer
- External Function:
buffer-size
- External Function:
buffer-size
- Function:
channel-clear-status
- Function:
clock-drift
- Function:
collision-model
- Function:
command
- Function:
data-rate
- Function:
deployment
- Function:
description
- Internal Function:
destination
- External Function:
disabled-p
- External Function:
disabled-p
- External Function:
exponential
- External Function:
exponential
- Function:
field
- Function:
get-clock
- Function:
get-simulation-time
- Function:
handle-control-command
- Function:
handle-sensor-reading
- Function:
header-overhead
- Function:
last-hop
- Function:
last-sequence-number
- Function:
location
- Function:
lqi
- Function:
mac-address
- Function:
max-mac-frame-size
- Function:
max-net-frame-size
- Function:
measure
- External Function:
network
- External Function:
network
- Function:
network-address
- Function:
next-hop
- Function:
next-sequence-number
- Function:
node
- Function:
nodeid
- Function:
nodes
- Function:
num-nodes
- Function:
packet-history
- Function:
packet-size
- Function:
parent-network-address
- Function:
payload
- Function:
payload-overhead
- Function:
physical-process
- Internal Function:
priority
- Function:
radio
- Function:
ram-store
- Function:
read-rssi
- Function:
resolve-network-address
- Function:
rssi
- Function:
sensor-request
- Function:
sequence-number
- Function:
set-state
- Function:
shutdown
- Function:
sink-network-address
- Function:
sink-p
- Inherited Function:
sleep
- Inherited Function:
sleep
- Function:
sleep-interval
- Internal Function:
source
- Function:
startup
- Internal Function:
state
- Function:
symbol-length
- Function:
to-mac
- Function:
to-network
- Function:
to-radio
- Function:
transition-delay
- Function:
tx-time
- Function:
wireless-channel
- Function:
- 5.3.1 External Classes
- 5.4 Ambiguous Symbols
- 5.5 Index
- 6 Colophon
1 Summary
Lisp Educational Network Simulator (LENS) is a discrete event simulation framework written in Common Lisp. It provides a generic architecture for modelling in problem domains where the system may be represented by the exchanging of messages between entities. It is being used to develop simulations for research into Wireless Sensor Networks.
1.1 Why Use LENS?
LENS is easier to extend and develop for than other network simulators.
The decision to write a new network simulator in |LISP| was based upon a number of observations:
- Simulation environments require a core model and a means for specifying particular simulations at run time. Most simulators have the core model written in a compiled language (e.g. C++) for efficiency and have a separate embedded run time interpreter (e.g. Tcl or a domain specific language) for describing the particular simulation. |LISP| provides the full language and compiler environment at run-time so there is no need for this separation.
- Users of a simulator will want to describe their problem in a way which matches their particular domain. |LISP| is an extensible language which is especially good for writing domain specific languages.
- LISP enables introspection of all aspects of the simulated system while it is running without any additional programming. Most other simulators provide only limited introspection capabilities which have to be explicitly programmed in.
- In modern LENS the simulations are run in a separate thread to the normal Common Lisp read-eval loop so the user can probe or modify the simulation even while it is running.
The architecture of LENS is inspired by the http://www.omnetpp.org/ [OMNET++ simulator framework written in C++ however may aspects of that design become simpler when implemented in LISP.
1.2 Dependences
LENS has been developed using the SBCL http://sbcl.sourceforge.net/ Common Lisp implementation. Implementation specific features are accessed through a thin compatibility layer in `core/compatibility.lisp` which is the only file that should need changed to port it to other implementations. Currently the only implementation feature used is threading so porting is a minimal task. If you do port LENS to another implementation please send me the changes to encorporate back into the main distribution.
LENS is dependant on the following additional Common Lisp libraries
- asdf: http://www.cliki.net/asdf
- Closer-MOP: http://common-lisp.net/project/closer/
- split-sequence: http://www.cliki.net/SPLIT-SEQUENCE
- trivial-gray-streams: http://www.cliki.net/trivial-gray-streams
- data-format-validation : http://www.cliki.net/CL-DATA-FORMAT-VALIDATION
- clrs : https://github.com/willijar/clrs
1.3 Installation
LENS is available from the GIT repository. You can clone and install LENS like this:
cd ~/src/ git clone https://github.com/willijar/LENS.git
1.4 How to Use
- The file
lens.asd
provides the asdf system definition for LENS. You should place a symbolic link to this file in a system definition directory where ASDF can find it. Similarly for - Load LENS with
(asdf:operate 'asdf:load-op :lens)
- Load the simulation system you want with
(asdf:operate 'asdf:load-op :simulation-system-name)
e.g.
(asdf:operate 'asdf:load-op :lens.samples)
for the provided example `samples` network. - Make the simulation package your current package
(asdf:operate 'asdf:load-op :simulation-package-name)
e.g.
(in-package :lens.samples)
for the provided example networks. - Load and run a simulation configuration from a configuration file
(run-simulations "configuration-file.ini" :config "section-name")
e.g.
(run-simulations +tictoc+ :config "TicToc2")
will run the sample simulation specified by section "TicToc2" in the samples configuration file (+tictoc+
is defined in the:lens.samples
package to point to this file)
1.5 Feedback
If you have have questions, remarks, or ideas about LENS or want to submit a bug report then please email me at mailto:J.A.R.Williams@aston.ac.uk
2 Using LENS
LENS provides a generic architecture for modelling systems that may be represented by entities exchanging discrete messages over time (such as communication systems). It is designed to support a modular system model design (enabling model component reuse) and a clear separation between the model implementation and the simulated experiments that are being carried out in it. Models are implemented in Common Lisp. Simulation experiments are specified using text configuration files and the results are produced in text data files which may then be analysed by further tools.
This document is a manual for implementing and using models in LENS
2.1 Introduction
Simulations of networks can provide a useful educational tool both for supporting traditional modular courses and for enabling students to carry out more open ended project work. In terms of research ultralow power wireless are an interesting engineering problem as they operate under significant resource constraints and the protocols and techniques that are needed are therefore very application dependant. Simulations provide an efficient way of investigating those challenges and potential solutions. A simulation framework that can support both these tasks would enable students to carry out research work in wireless sensor networks as part of their projects.
There are many discrete time event network simulators available. Those which are most widely used (such as NS2 and it's derivatives) are popular because they have been around a long time and a very large number of network models have been written for them. The range of models available has outgrown the original framework design and this gives rise to many workarounds and the introduction of substantial unnecessary complexity. This growth of baroque complexity makes it very difficult to fully understand the details of the models or to modify or customise them. As the models continue to grow this is becoming harder and harder. While there have been attempts to re-factor some of these large simulator frameworks they have met with limited success - partly because one of the goals is to try to maintain some sort of compatibility with the legacy of complex models.
An alternative is to design a new simulator framework based on experience of the limitations of the previous designs which have led to the growth in their complexity. One such framework is OMNET++ which is a simulator framework written in C++ which addresses the design issues. The disadvantage is that it does have the wide range of network models available as the more long standing simulators.
Traditionally simulation models are typically made up of a fixed compiled component written in C or C++ for efficiency and a run time interpreted component to allow customisation without having to recompile for every model change. The run time component is either in a dynamic extension language (such as Tcl for NS2) or a custom language (NED for OMNET++). This simulation models are typically spread across at least two files in two different programming languages. Aspects which have been fixed in the compiled model cannot be changed at run time. It is not always transparent which aspects of the model should be fixed and which should be configurable at model implementation time, nor is it obvious in complex models where to find different aspects of the implementation.
From experience I have found that students take too long to have sufficiently in depth understanding of the Baroque mature simulators to write new models withing the 6 month time frame allowed for Masters projects. They are suitable for projects involving running currently available models but not if the project is to evaluate some new model. Additionally, when looking for a network simulator to carry out more complete systematic evaluation of wireless sensor networks I found that none of the already existing network simulators had implementations of all the protocols of interest. No matter which simulator I chose I would need to port across implementations of protocols.
On this basis a new simulator framework \acr{LENS} has been designed. Many aspects of the architecture are based on the excellent design of OMNET++ however it was written entirely in \gls{CL}. \gls{CL} provides a dynamic compiled environment with full introspection capabilities during run time. It is an extensible language which is especially good for domain specific customisation. There is therefore no need to use or design a separate interpreted language for the dynamic aspect. This simplifies the design - typically a single protocol will be fully described in a single file containing a class definition describing its state variables and configurable parameters as well as its implementation. Full use has been made of the [[CLOS] [Common Lisp Object System (CLOS)] to provide modularity in the design and the associated Meta Object protocol has been used to handle cross cutting concerns in the design. It was considered that the initial investment in designing the simulation framework would pay off when having to port protocols across to it and when designing new protocols.
2.2 Overview
(defclass communications(compound-module) () (:gates (application :inout) (channel :inout)) (:submodules (routing routing) (mac mac) (radio radio)) (:connections (<=> application (routing application)) (<=> (routing mac) (mac routing)) (<=> (mac radio) (radio mac)) (<= (radio receive) channel)) (:metaclass compound-module-class) (:documentation "A Communications module"))
A Compound module example with three submodules
LENS is a discrete time event simulator. It is suitable for simulating systems which can be represented as a set of entities exchanging discrete messages over time. It supports a hierarchical design methodology where complex entities (called compound modules) are broken down into smaller networks of components etc until we get to simple modules (or just modules) which contain the specific implementation details of the system being modelled. The modules (whether simple or compound) interact by send and received messages through named gates. Connections between gates are represented using channels which may include delays and modify the messages (for example adding in message loss or errors). The system models are described and implemented using the Common Lisp (CL) programming language. Figure fig:compound shows an example of a compound communications model with the CL and the associated graphical representation. The system component types are defined as classes using CLOS - part of this definition is the set of configurable parameters for the model which will be read from a configuration file when it is being run.
Simulations are used to run a series of experiments which varying system parameters and to collect a measurements of the system performance for each experiment. LENS provides separation of the system model from the specification of the experiments being performed. It is not necessary to change the model to carry out different experiments. Experiments are described in configuration files which specify what parameters to use and what measurements are to be recorded. A single configuration file may describe many different named experiments and may also specify a series of experiments with varying parameters.
The model implementation modules are instrumented by signalling signal useful events or value changes using emit. These signals may be handled by the simulator to collect statistics and provide performance evaluation reports. They might also be used to update various views of the running simulation (for example a graphical display). No such graphical display is currently implemented.
The framework is generic and many different models may be represented
using it. It is recommended that a package be created for each model
which uses the :lens
package (as well as :cl
and :cl-user
)
and that all declarations for that model are made in it's
package. This will prevent namespace collisions between models. Users
should then be in a particular model package when running it. When
reading parameters the :lens
namespace is used by default so
symbols which may be read from external files will need to be
specified either with an explicit package name or be exported into the
:lens
package. Parameter names however are parsed as strings as
they are addressed by their position in the model hierarchy and so the
package in which they are declared is ignored.
2.3 Network Description
Simulations are represented as a heirarchical network of modules interconnected using channels. Every simulation must have one top level network module which will specify submodules and their interconnections. These submodules may be compound modules which can contain further submodules or simple modules which contain implementations. All module types are declared as CLOS classes inheriting from network, compound-module and module base classes as appropriate. In addition module classes must declare a metaclass - compound-module-class for networks and compound modules and module-class for simple modules. These meta-classes allow for the declaration of parameter slots (where the value may be initialised from the configuration file), gates, submodules and connections in the class definition. When a simulation is run the network type is read from the parameter file and created. This will then create the submodules and so on until the whole network is created.
2.3.1 Network Modules
A network topology is described using the declaration of a new class of type network.
(defclass TicToc1(network) () ;; No parameters declared (:submodules ;; submodule declaration (tic Txc1) (toc Txc1)) (:connections ;; interconnection declaration (=> (delay-channel :delay 0.1d0) (tic out) (toc in)) (=> (delay-channel :delay 0.1d0) (toc out) (tic in))) (:metaclass compound-module-class)) ;; metaclass required
This network is called TicToc1
. It has no slots or parameters specified. The
:submodules
class option specifies a list of two node submodules
named tic
and toc
each of must be of type Txc1
(which
we will define later). The :connections
class option specifies
connections between the gates of these submodules - in this case there
are two connections - one from the out gate of each module to the in
gate of the other module each using a delay-channel with a delay of
0.1 sec. Networks are compound modules withp=out any gates (external
connections) and so must use the compound-module-class
metaclass. There is usually just one network instance for each simulation.
Declarations are placed in lisp files and loaded as usual into your lisp environment. For every simulation the user will need to specify the network name in the configuration file.
[General] network=TicToc1
2.3.2 Simple Modules
Simple modules are the basic building blocks defining the network
behaviour. In the example above we declared two submodules each of
type Txc1
which could be declared as simple modules. A minimal
declaration is given below.
(defclass Txc1(module) () (:gates ;; gate declarations (in :input) (out :output)) (:metaclass module-class)) ;; module-class metaclass required for simple modules
In this declaration we have defined a module which has two gates, one
input gate which can receive messages named in
and one output gate
which can send messages named out
. These named gates were used when
specifying the connections for the TicToc
network declared
previously.
In addition to declaring the simple model class we need to define an implementation. We do this by writing methods with the required behaviour. In this case we want the modules to resend a message to their output gate when they receive it on their input gate. Additionally to get the process started we need one of the modules to send a message on startup.
(defmethod initialize list ((module Txc1) &optional (stage 0)) (when (eql (name module) 'tic) (send module (make-instance 'message :name 'TicTocMsg) 'out)) t) (defmethod handle-message((module Txc1) msg) (send module msg 'out))
After the simulator has constructed the network entities from the
definitions and configuration file the initialize generic
function is called recursively depth first on the network hierarchy.
This takes the module an initialisation stage number as
arguments. Simple Modules define their initialisation here and return
true if their initialisation is finished. Multiple stage
initialisation is enabled. This may be necessary where there is a
cross dependence in initialisation between modules. In this case the
initialize
function will be called with increasing stage number
until it returns true i.e. if a module requires multiple stage
initialisation it should return nil until it has reached its last
stage when it should return true. In this simple example we only want
one module to start the message sending process so we check it is
named tic
and if so send a new message to the out
gate.
When a message is received by a module the handle-message method is
called with the module and message arguments. Every simple module will
want to specialise this method to implement their behaviour. In this
example it is specialised on the Txc1
class and it immediately
calls send to send the message to the out
gate of the module.
2.3.3 Compound Modules
The above network nodes were very simple and could be implemented as simple modules. In general however nodes will involve complex behaviour and we will want to break their implementation down into simpler components. A compound module can be used in this case. Figure fig:compound shows an example of such a module. It has the list of submodules and connections (as per the network modules) as well as a list of external gates which can also be connected to submodule gates.
Generally all of the behavioural implementation is defined in simple modules however it is possible to add to or override some of the default behaviour in compound modules. An example of this is were the network of submodules and interconnections may be parameterised and therefore a method may be added to add in the necessary network behaviour creation before module initialisation 1.
2.3.4 Gates
Gates are the named input and output ports of both simple or compound
modules. They are given symbolic names, and may be declared either as
:input
, :output
or :inout
(which creates both an input and
output gate of the same name. Additionally a numerical second argument
may be used to declare an array of gates. This may be 0 indicating
that it the array may be extended during module initialisation or may
be the name of a module slot specifying the size. The basic addressing
format for gates is (name [index] [direction])
or name
which is
used by the gate generic function to return a named gate for a
module. The :index
keyword argument '++ may be used to indicate that
a new gate should be created on the addressed gate array. If the
direction is obvious from the context (e.g. it must be :output
when
sending a message) then it may be left off the address.
2.3.5 Channels
Channels are the final component types which are used to create a
simulation. LENS provides two inbuilt channel types. The
ideal-channel which is the default and has zero
propagation and transmission delay and is always enabled. The
delay-channel has a propagation delay specified using a
:delay
argument and may be disabled. In addition the
transmission-channel base class is provided for more complex
behaviour - taking account of transmission time, packet loss etc. Most
derived channels will be based on this class and must specialise the
process-message generic function to provide the required
functionality. This method should model the transmission of the given message starting
at the given time, and return the propagation delay, transmission
duration, and discard flag in a channel-result structure. The
transmission duration and bit error modeling only applies to instances
of packet and should be skipped for non-packet messages. The
method does not need to set the duration of the packet; this is done
by the simulation kernel. However, the method should set the bit-error-p
on the packet if error modeling results in bit errors. If the
discard flag is set in the result object, it means that the message
object should be deleted by the simulation kernel; this facility can
be used to model that the message gets lost in the channel.
The method does not need to throw error on overlapping transmissions, or if the packet's duration field is already set; these checks are done by the simulation kernel before process-message is called.
In addition they may wish to implement nominal-datarate and calculate-duration methods.
2.3.6 Parameters
All modules and channels can be configured using named
parameters. In LENS parameters are defined as slots in
the class definition with :parameter
argument set to true. If the
slot is not initialised by slot argument during object creation the
object will try and read a value from the configuration file. If no
value is defined in the configuration file then the default
initialisation form is evaluated and used 2.
(defclass Txc4(Txc1) ((send-msg-on-init :parameter t :initarg :send-msg-on-init :initform nil :type boolean :reader send-msg-on-init :documentation "Whether module should send message on initialization")) (:metaclass module-class))
In this example The send-msg-on-init
instance slot is declared as a parameter. If the initialisation
argument :send-msg-on-init
is specified during creation of a
Txc4
(either in code or in the module specification in a compound
module) then its value will be used. Otherwise the simulation
configuration will be checked for a value. Finally if neither of these
are specified the :initform
value will be used as the default.
When declaring parameter slots you should specify a
format to be used to parse the configuration string into an internal
type. By default this is derived from the declared slot :type
however the slot :format
may be used to customise this parsing
for example to allow for additional error checking. This argument
takes any format type specification understood by the
data-format-validation
library and new format types may be added
as per that library. If no format or type are declared the parameter
will be read in as a string.
2.4 Messages and Packets
message instances in LENS are used to represent events, packets, commands, jobs, customers and other types of entities depending on the model domain. They may be sent through gates and channels between modules or may be send directly to a module. The base message class records the creation time, transmission time, arrival time and the source and destination entites. The send generic function provides the basic mechanism for a module to send a message out through one of its named gates. The gate can be an actual gate object or it's specifier.
The simulator will call handle-message with the module and message when at the message arrival time.
packet instances objects are messages used to represent network packets.
All message and packet types must override the duplicate method to provide proper duplication semantics (i.e. must explicitely copy slots from an originating packet to a duplicate one. The encapsulate and decapsulate methods are used to embed and access higher level encapsulated packets. Duplication does results in the originating and duplicate packets sharing the same encapsulated packet - however decapsulating returns a duplicate of the encapsulated packet ensuring appropriate copy semantics are maintained efficiently through this interface.
The control-info field in packets may be used to pass additional information with packets as they are passed between protocol layers - for example command information to a lower layer as the packet is passed down or additional information associated with packet reception as the packet is passed up a protocol stack.
2.5 Signals and Instrumentation
For a simulation to be useful it must collect useful information on the model operation. Separating our the generation of the information from the collecting and reporting of it allows for the maximum flexibility and generality. The LENS this is achieved with the use of named signals which may be emitted with useful information in the model implementation code and which can then be collected and analysed by listeners attached to the various modules in the simulation.
The register-signal function is normally called as a top level form to register a particular named signal with the symbol. Adding documentation is recommended so that other implements may reuse it if they have similar semantics. Registering commonly used signals ensures that their handling will be optimised.
In the model implementation the emit method is called to broadcast a signal. This may optionally take an argument (for example a count) associated with that signal. Listeners registered to receive this signal in the broadcasting module or above it in the hierarchy will all receive the signal in via the receive-signal method. If the generation of the broadcast signal is expensive the may-have-listeners function may be called to check whether it is necessary first.
Modules call the subscribe and unsubscribe functions to register or unregister a listener object for a particular signal on a particular module. A listener may be registered to more than one signal or module and can use the source-component, signal and value arguments to differentiate the source as required).
As an example an application module might register signals for packet transmission and reception at the top level in the source file.
(register-signal 'packet-receive "Emitted when application receives a packet.") (register-signal 'packet-send "Emitted when application sends a packet.")
In the relevant code implementation for transmission and reception it may call
(emit application 'packet-send packet)
or (emit application 'packet-receive packet)
respectively to inform the relevant listeners of
these events. These send the actual packet as a value. Listeners
should not modify the packet but may read values from them.
2.5.1 Statistics
Network instrumentation is performed by registering listeners which can receive signals and perform the relevant analysis. These are registered as part of a module class declaration as statistic properties of that module e.g.
(defclass application(wsn-module) ( ;; parameter declarations ) (:gates ;; gate declarations } (:properties :statistic (latency :source (latency packet-receive) :title "application latency" :default ((histogram :min 0))) :statistic (packet-receive :title "application packets received" :default (count)) :statistic (packet-receive-per-node :title "packets received per node" :source (source (control-info packet-receive)) :default (indexed-count)) :statistic (packet-send :title "application packets sent" :default (count))) (:metaclass module-class) (:documentation "Application connects to sensors for measurements and to communication module for sending/receiving data."))
This example declares four different statistics associated using the
packet-send
and packet-receive
signals. Each statistics is
given a name and title (used in reports), a source declaration (a
function which when applied to the signal value will return a number)
and a list of default and optional statistics to be performed on the
source value. These statistics are registered listener classes which
will collect their received values and produce either scalar or
vector outputs from the simulation for analysis. See the
statistics.lisp
and statistics-impl.lisp
core files for
more information. Whether a particular statistic is active or not is
controlled in the simulation configuration file - those declared as
default are active unless turned off and those declare optional are
not active unless turned on in the configuration file. The
framework allows for the implementation and declaration of new
statistic listener types if required.
3 Internal Package: lens
3.1 Description
This package provides the main simulation framework. It is intended that every simulation system will be defined in its own package which will use this package to import the public API. Simulations should be run from within the dynamic context of their specific simulation package so that symbolic configuration parameters will be read into the correct package.
Simulations are represented as a heirarchical network of modules interconnected using channels. Every simulation must have one top level network module which will specify submodules and their interconnections. These submodules may be compound modules which can contain further submodules or simple modules which contain implementations. All module types are declared as CLOS classes inheriting from network, compound-module and module base classes as appropriate. In addition module classes must declare a metaclass - compound-module-class for networks and compound modules and module-class for simple modules. These meta-classes allow for the declaration of parameter slots (where the value may be initialised from the configuration file), gates, submodules and connections in the class definition. When a simulation is run the network type is read from the parameter file and created. This will then create the submodules and so on until the whole network is created.
3.2 Class Hierarchy
3.3 External Symbols
3.3.1 External Classes
External Class: channel
Inheritance
- Parent classes: component
- Precedence list: channel, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: delay-channel, transmission-channel, ideal-channel
Parameters
None.
Description
Base class for all channels entities in the simulations. Channells are attached to their source gate.
Direct Slots
source-gate
- Value type:
t
- Initial value:
NIL
- Initargs: source-gate
- Allocation: instance
The gate which sends messages over the channel.
source-gate
(source-gate object)
- (
source-gate
(channelchannel
))
Indirect Slots
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: component
Inheritance
- Parent classes: parameter-object, entity-with-signals
- Precedence list: component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: module, channel
Parameters
- collect-trace-info
- a
boolean
. If true tracelog outputs will be traced for this component.
Description
class component adds in random number sequence mapping and tracing functionality on top of parameter and signal handling. It is the base class for all modules and channels in simulation which require these.
- rng-<n>
- a
integer
. Specifies the global random number sequence number to be mapped to then
th sequence for this component - scalar-recording
- a
boolean
. If true scalar recording will be activated for statistics objects associated with this component. - vector-recording
- a
boolean
. If true vector recording will be activated for statistics objects associated with this component.
Notes
Both tracing (using tracelog) and rng mapping depend on
the *context*
dynamic global variable being set to the correct component.
This is set for initialize-instance, finish and for handle-message.
Functions or methods designed to be used to access a component
directly outside these contexts must explicitely bind *context*
around
around any dynamic context using random number generation or tracing.
and should do it in all such cases as a matter of safe practice.
Direct Slots
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
RNG map for this component
rng-map
(rng-map context)
- (
rng-map
(componentcomponent
)) - (
rng-map
(simulationsimulation
)) - (
rng-map
(context (eql nil)))
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
True if this component has been initialized.
initialized-p
(initialized-p component)
- component
- a simulation component
Returns true if an entity has finished its initialization using the initialize method.
- (
initialized-p
(componentcomponent
)) - (
initialized-p
(simulationsimulation
))
Indirect Slots
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: compound-module
Inheritance
- Parent classes: module
- Precedence list: compound-module, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: wireless-channel, node, communications, network
Parameters
None.
Description
Base class for all compound-modules using the compound-module-class metaclass. See class compound-module-class for details of the additional class slot options available.
Typically no further implementation beyond the class specification is
used with compound modules as messages will be automatically routed in
the gates of submodules as per the :connections
specifications. It
is however allowed to have unconnected gates in which case
handle-message must be implemented to receive the messages. This
would allow some implementation in compound modules which they might
then send to several contained submodules.
The build-submodules and build-connections may be usefully extended to allow algorithmic creation of the contained network.
Direct Slots
submodules
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
submodules
(submodules object)
- (
submodules
(compound-modulecompound-module
))
channels
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
channels
(channels object)
- (
channels
(compound-modulecompound-module
))
Indirect Slots
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: compound-module-class
Inheritance
- Parent classes: module-class
- Precedence list: compound-module-class, module-class, parameter-class, standard-class, std-class, slot-class, pcl-class, class, dependent-update-mixin, plist-mixin, definition-source mixin, standard-specializer, specializer, metaobject, standard-object, slot-object, t
- Direct subclasses: None.
Additional Class Options
- types
- ( (typename initargs)* )
- typename : a
symbol
- initargs : (classname {keyword argument}*)
- typename : a
- submodules
- ( (submodule-name [/sizespec/] ((classname | typename) {keyword argument}* ) *)
- submodule-name : a
symbol
- sizespec : (integer | (sizeof gate-name) | slot-name)
- submodule-name : a
- connections
- ( (gate-specifier [/channel-spec/] direction gate-specifier)* )
- gate-specifier : (gate-name | (submodule-name gate-name))
- channel-spec : ((classname | typename) {keyword argument}* )
- direction : (
> | <=> | <
)
Description
Metaclass for all compound modules classes - the base class for modules with gates, submodules and connections between those submodules and gates. Must be used as metaclass for compound-module classes.
See module-class for details on the :gates
class option.
The :types
class option provides a way of providing a mapping
between a single symbolic typename and a list of initargs which
would correspond to the classname and keyword arguments passed in
construction of either a submodule or channel. These names thus
provide a useful shortcut when defining submodules or channels. If a
typename is specified with some additional arguments they will
override the default ones.
The :submodules
class option provides a list of submodule class
specifications consisting of the local name for the submodule, an
optional sizespec if an array of submodules is to be created and the
arguments to make-instance
to be used. A previously defined local
type shortcut may be used instead of the classname. At creation the
:owner
keywword will be added to the initargs with the current
instance as the argument. A sizespec may either be an integer, a
symbolic slot-name corresponding to one of the slots in the class or
(sizeof gate-name)
which will correspond to the size of the array of
gates with the given gate-name.
The :connections
class option specifies connections between
gates. Gates are specified either as the gate name if a gate in the
current module or a list of submodule name and gate name for
submodules. They may additionally have an index parameter if
corresponding to gate arrays. The direction specifier specifies the
direction of connection, <=>
may be used to provide connections in
both directions between :inout
gates. An optional channel specifier
may be used as the second argument specifying the channel type and
initargs for creating the channel. The type may be a local type
definied with the :types
slot option. The :name
argument may be
used to give individual channels names - otherwise they will be named
after their type name. The :owner
keyword argument will be added
with the current object instance as the argument.
Direct Slots
%localtypes
- Value type:
list
- Initial value:
NIL
- Initargs: types
- Allocation: instance
%submodules
- Value type:
list
- Initial value:
NIL
- Initargs: submodules
- Allocation: instance
%connections
- Value type:
list
- Initial value:
NIL
- Initargs: connections
- Allocation: instance
Connection specification for this class
Indirect Slots
%gatespec
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
incompatible-superclass-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
can-precede-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cpl-available-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%class-precedence-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%documentation
- Value type:
t
- Initial value:
NIL
- Initargs: documentation
- Allocation: instance
direct-methods
- Value type:
t
- Initial value:
(CONS NIL NIL)
- Initargs: none
- Allocation: instance
direct-subclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
direct-superclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
class-eq-specializer
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
name
- Value type:
t
- Initial value:
NIL
- Initargs: name
- Allocation: instance
source
- Value type:
t
- Initial value:
NIL
- Initargs: definition-source
- Allocation: instance
External Class: delay-channel
Inheritance
- Parent classes: channel
- Precedence list: delay-channel, channel, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- delay
- a
time-type
. Default:0.0d0
. The propagation delay in seconds - disabled-p
- a
bool
. NIL
Description
A channel with propagation delay.
Direct Slots
delay
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: delay
- Allocation: instance
- Parameter: t
- Properties: nil
The propagation delay in seconds
disabled-p
- Value type:
bool
- Initial value:
NIL
- Initargs: disabled
- Allocation: instance
- Parameter: t
- Properties: nil
disabled-p
(disabled-p object)
- (
disabled-p
(wsn-modulelens.wsn:wsn-module
)) - (
disabled-p
(delay-channeldelay-channel
))
Indirect Slots
source-gate
- Value type:
t
- Initial value:
NIL
- Initargs: source-gate
- Allocation: instance
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: entity-with-signals
Inheritance
- Parent classes: owned-object
- Precedence list: entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: packet-buffer, component
Description
An entity which can subscribe to and emit and receive-signal signals.
Direct Slots
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash by signal of lists of registered listeners for this entity.
signal-table
(signal-table object)
- (
signal-table
(entity-with-signalsentity-with-signals
))
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
A bit map recording which signals have ancestor listeners.
Indirect Slots
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: gate
Inheritance
- Parent classes: owned-object
- Precedence list: gate, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Represents a module gate. Created and managed by modules; the user typically does not want to directly create or destroy gate objects. However, they are important if a module algorithm needs to know about its surroundings. Module gates connect only in one direction. Bidirectional connections result in two chains of gates going in each direction.
Direct Slots
previous-gate
- Value type:
link
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The previous gate in the series of connections (the path)
previous-gate
(previous-gate object)
- (
previous-gate
(gategate
))
next-gate
- Value type:
link
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The next gate in the series of connections (the path)
channel
- Value type:
channel
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Channel object (if exists) to next link
deliver-on-reception-start-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Messages with nonzero length then have a nonzero transmission duration (and thus, reception duration on the other side of the connection). By default, the delivery of the message to the module marks the end of the reception. Setting this bit will cause the channel to deliver the message to the module at the start of the reception. The duration that the reception will take can be extracted from the message object, by its duration() method.
deliver-on-reception-start-p
(deliver-on-reception-start-p object)
- (
deliver-on-reception-start-p
(gategate
))
Indirect Slots
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: gate-slot
Inheritance
- Parent classes: owned-object
- Precedence list: gate-slot, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Named storage slot for gate or gates - direction initarg must be specified as :input, :output or :inout. If an initial size is given then it will be an array of gates and access must by index
Direct Slots
input
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Slot for input gate or gates
output
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Slot for output gate or gates
Indirect Slots
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: histogram
Inheritance
- Parent classes: stddev
- Precedence list: histogram, stddev, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Base class for density estimation classes.
For the histogram classes, you need to specify the number of cells and the range. Range can either be set explicitly or you can choose automatic range determination.
Automatic range estimation works in the following way:
- The first num_firstvals observations are stored.
- After having collected a given number of observations, the actual histogram is set up. The range (min, max) of the initial values is expanded range_ext_factor times, and the result will become the histogram's range (rangemin, rangemax). Based on the range, the cells are layed out. Then the initial values that have been stored up to this point will be transferred into the new histogram structure and their store is deleted – this is done by the transform() function.
You may also explicitly specify the lower or upper limit and have the other end of the range estimated automatically. The setRange…() member functions of cDensityEstBase deal with setting up the histogram range. It also provides pure virtual functions transform() etc.
Subsequent observations are placed in the histogram structure. If an observation falls out of the histogram range, the underflow or the overflow cell is incremented.
Direct Slots
range-min
- Value type:
real
- Initial value:
NIL
- Initargs: min
- Allocation: instance
range-min
(range-min object)
- (
range-min
(histogramhistogram
))
range-max
- Value type:
real
- Initial value:
NIL
- Initargs: max
- Allocation: instance
range-max
(range-max object)
- (
range-max
(histogramhistogram
))
range-ext-factor
- Value type:
real
- Initial value:
1
- Initargs: range-ext-factor
- Allocation: instance
Factor to expand range by
range-ext-factor
(range-ext-factor object)
- (
range-ext-factor
(histogramhistogram
))
mode
- Value type:
symbol
- Initial value:
NIL
- Initargs: mode
- Allocation: instance
integer or float mode for collection.
histogram-mode
(histogram-mode object)
- (
histogram-mode
(histogramhistogram
))
rng
- Value type:
fixnum
- Initial value:
0
- Initargs: genk
- Allocation: instance
num-cells
- Value type:
fixnum
- Initial value:
10
- Initargs: num-cells
- Allocation: instance
How many cells to use.
num-cells
(num-cells object)
- (
num-cells
(histogramhistogram
))
cell-size
- Value type:
real
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Cell size once scale determined.
array
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Pre-collected observations or cells
underflow-cell
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
Number of observations below range-min
underflow-cell
(underflow-cell object)
- (
underflow-cell
(histogramhistogram
))
overflow-cell
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
Number of observations above range-max
overflow-cell
(overflow-cell object)
- (
overflow-cell
(histogramhistogram
))
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~3@/dfv:eng/"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: history-buffer
Inheritance
- Parent classes: standard-object
- Precedence list: history-buffer, standard object, slot-object, t
- Direct subclasses: None.
Description
A class for recording the history of seen objects. The duplicate-p method is called with an object and will return true if the object is previously recorded in the history of this buffer.
Additional Initialization Arguments
- :size
- an
integer
specifies the size of the history buffer (number of previous entities to remember) - :element-type
- a type specification for the elements to be stored in the histire buffer.
Direct Slots
queue
- Value type:
vector-wrap-queue
- Initial value:
NIL
- Initargs: none
- Allocation: instance
queue
(queue object)
- (
queue
(history-bufferhistory-buffer
)) - (
queue
(packet-bufferpacket-buffer
))
test
- Value type:
t
- Initial value:
#'EQUALP
- Initargs: test
- Allocation: instance
The test function to compare entities
buffer-test
(buffer-test object)
- (
buffer-test
(history-bufferhistory-buffer
))
key
- Value type:
t
- Initial value:
#'IDENTITY
- Initargs: key
- Allocation: instance
The jey function to use to compare entities.
buffer-key
(buffer-key object)
- (
buffer-key
(history-bufferhistory-buffer
))
External Class: ideal-channel
Inheritance
- Parent classes: channel
- Precedence list: ideal-channel, channel, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
None.
Description
Channel with zero propagation delay, zero transmission delay (infinite datarate), and always enabled.
Direct Slots
Indirect Slots
source-gate
- Value type:
t
- Initial value:
NIL
- Initargs: source-gate
- Allocation: instance
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: indexed-count-recorder
Inheritance
- Parent classes: scalar-recorder
- Precedence list: indexed-count-recorder, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Indexed count records the number of times a
particular value is received. Values are compare using EQL. If a
CONS is recieved using record the car
is taken as the index
key and the cdr
is the amount the count is to be incremented.
This provides a means e.g. to record the number of packets received by source at a destination etc.
The recorder reports as a statistic with the keys as field names.
Direct Slots
count
- Value type:
t
- Initial value:
(MAKE-HASH-TABLE :TEST #'EQUAL)
- Initargs: none
- Allocation: instance
recorded-value
(recorded-value scalar-recorder)
Return the value to record for a scalar recorder
- (
recorded-value
(raccumulated-time-recorder
)) - (
recorded-value
(indexed-count-recorderindexed-count-recorder
)) - (
recorded-value
(rtimeavg
)) - (
recorded-value
(last-valuelast-value
)) - (
recorded-value
(recordermean
)) - (
recorded-value
(sumsum
)) - (
recorded-value
(count-recordercount recorder
))
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~A"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: last-value
Inheritance
- Parent classes: scalar-recorder
- Precedence list: last-value, scalar-recorder, result-recorder, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: max-recorder, min-recorder
Description
Record the last value received.
Direct Slots
value
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
recorded-value
(recorded-value scalar-recorder)
Return the value to record for a scalar recorder
- (
recorded-value
(raccumulated-time-recorder
)) - (
recorded-value
(indexed-count-recorderindexed-count-recorder
)) - (
recorded-value
(rtimeavg
)) - (
recorded-value
(last-valuelast-value
)) - (
recorded-value
(recordermean
)) - (
recorded-value
(sumsum
)) - (
recorded-value
(count-recordercount recorder
))
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~A"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: mean
Inheritance
- Parent classes: scalar-recorder
- Precedence list: mean, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Record the mean of the numeric values received.
Direct Slots
count
- Value type:
t
- Initial value:
0
- Initargs: none
- Allocation: instance
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~A"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: message
Inheritance
- Parent classes: event, owned-object
- Precedence list: message, event, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: wireless-signal-start, communications-control-command, communications-control-message, sensor-message, timer-message, packet
Description
Messages objects represent events, packets, commands, jobs, customers or other kinds of entities, depending on the model domain.
Direct Slots
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
creation-time
(creation-time object)
- (
creation-time
(messagemessage
))
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Module or gate from which message was originally sent.
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Module or Gate which finally receices message (after a delay if appropriate)
sent-time
- Value type:
time-type
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The simulation time the message was sent.
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
Utility time stamp field for user
Indirect Slots
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: module
Inheritance
- Parent classes: component
- Precedence list: module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: log-distance, temporal-model, no-temporal-model, physical-process, wsn-module, compound-module
Parameters
None.
Description
Base class for all modules which must have metaclass module-class.
Modules are used to implement protocols by specialising on the following methods.
- initialize method may be used to specify initial configuration of the module after creation but before the simulation starts. It may for example send a self message to initiate some process.
- handle-message is used to receive and process all incoming messages.
- send is used to send messages out of a gate.
- schedule-at is used to schedule self messages.
Direct Slots
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
Indirect Slots
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: module-class
Inheritance
- Parent classes: parameter-class
- Precedence list: module-class, parameter class, standard-class, std class, slot-class, pcl-class, class, dependent-update mixin, plist-mixin, definition-source-mixin, standard specializer, specializer, metaobject, standard-object, slot-object, t
- Direct subclasses: compound-module-class
Additional Class Options
- gates
- ( (gate-name direction [/size]/)*)
- gate-name : a
symbol
- direction :
(:input | :output | :inout)
- size : an
integer
- gate-name : a
Description
Metaclass for entities with gates. Must be used as metaclass for module classes.
The gates class option specified what gates are to be created for
instances of classes of this type. The gate-name specifies the
symbolic name to be used to identify the gate and must be unique for
this module. If direction is specified as :inout
both input
and output gates will be created. If size is specified an array
of gates will be created. A size of zero can be useful to allow for
the automatic creation of the gates on demand depending on the
connections the module.
Direct Slots
%gatespec
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The parsed gate specification used to build gates for this class
Indirect Slots
properties
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
incompatible-superclass-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
can-precede-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cpl-available-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%class-precedence-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%documentation
- Value type:
t
- Initial value:
NIL
- Initargs: documentation
- Allocation: instance
direct-methods
- Value type:
t
- Initial value:
(CONS NIL NIL)
- Initargs: none
- Allocation: instance
direct-subclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
direct-superclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
class-eq-specializer
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
name
- Value type:
t
- Initial value:
NIL
- Initargs: name
- Allocation: instance
source
- Value type:
t
- Initial value:
NIL
- Initargs: definition-source
- Allocation: instance
External Class: mt-random-state
Inheritance
- Parent classes: standard-object
- Precedence list: mt-random-state, standard object, slot-object, t
- Direct subclasses: None.
Description
The Mersenne Twister is an algorithm for generating random numbers. It was designed with consideration of the flaws in various other generators. The period, 2^19937-1, and the order of equidistribution, 623 dimensions, are far greater. The generator is also fast; it avoids multiplication and division, and it benefits from caches and pipelines. For more information see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html
Reference
- Matsumoto and T. Nishimura, 'Mersenne Twister: A 623-Dimensionally
Equidistributed Uniform Pseudo-Random Number Generator', ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
Direct Slots
arr
seed
- Value type:
t
- Initial value:
NIL
- Initargs: seed
- Allocation: instance
External Class: named-object
Inheritance
- Parent classes: lens-object
- Precedence list: named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: simulation, owned-object
Description
Not documented.
Direct Slots
name
- Value type:
symbol
- Initial value:
NIL
- Initargs: name
- Allocation: instance
Name of this object - used when addressing the object internally or through simulation paramaters.
name
(name object)
- (
name
(linkgate
)) - (
name
(named-objectnamed-object
))
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Position in an object vector (if it is in an object array)
External Class: network
Inheritance
- Parent classes: compound-module
- Precedence list: network, compound-module, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: wsn
Parameters
None.
Description
Base class for networks. This is the required type
for the top-level compound-module of a simulation network and it
is required that it has no gate specification. It is specified in
the network
simulation parameter.
Direct Slots
gate-slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Indirect Slots
submodules
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: owned-object
Inheritance
- Parent classes: named-object
- Precedence list: owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: result-recorder, gate-slot, gate, message, entity-with-signals
Description
Not documented.
Direct Slots
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
Object which owns this in object heirarchy
Indirect Slots
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: packet
Inheritance
- Parent classes: message
- Precedence list: packet, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: wsn-packet, application packet, wireless-signal-end
Description
Representation of network packets. Packets are messages which may take time to deliver over transmission links.
Protocol modules will typically encapsulate a packet from an upper level in a packet message type, adding in any additional fields before passing to a lower level]]. On receiving their packet from a lower level they can call decapsulate to get the original encapsulated packet to pass on to upper levels. If a packet is to be sent to multiple destinations then duplicate must be called to create multiple copies as required.
Direct Slots
encapsulated-packet
- Value type:
packet
- Initial value:
NIL
- Initargs: encapsulated-packet
- Allocation: instance
duration
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
Duration of last transmission
control-info
- Value type:
t
- Initial value:
NIL
- Initargs: control-info
- Allocation: instance
Additional data to be passed with packet between protocol layers.
control-info
(control-info object)
- (
control-info
(packetpacket
))
reception-start-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: deliver-on-reception-start
- Allocation: instance
Identify whether this packet represents the start or the end of the reception after the packet travelled through a channel with a data rate. This flag is controlled by the deliver-on-reception-start flag of the receiving gate.
reception-start-p
(reception-start-p object)
- (
reception-start-p
(packetpacket
))
bit-error-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The result of error modelling after the packet is sent through a channel that has a nonzero packet error rate (PER) or bit error rate (BER). It is up to the receiver to examine this flag after having received the packet, and to act upon it.
bit-error-p
(bit-error-p object)
- (
bit-error-p
(packetpacket
))
Indirect Slots
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: packet-buffer
Inheritance
- Parent classes: entity-with-signals, parameter-object
- Precedence list: packet-buffer, entity with-signals, owned-object, named-object, lens-object, parameter-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- buffer-size
- a
fixnum
. Default:32
. max buffer size in messages - buffer-size-bytes
- a
fixnum
. max size in bytes
Description
A packet buffer emplements the queue interface for packets using a timestamped queue. dequeue and peek from a timestamped-queue returns this time as a second value. It also keeps track of the average queue duration which can be obtained using average-queue-time.
It keeps track of the buffer size which may be set using the
buffer-size
or buffer-size-bytes
parameters. packets are
dropped if either maximum buffer size is exceeded and the drop
signal will be generated with the dropped packet as the
argument. Every time the queue length is changed the buffer-length
and buffer-time
events are generated with the buffer and the
duration the packet was in the buffer respectively.
Direct Slots
queue
- Value type:
timestamped-queue
- Initial value:
NIL
- Initargs: none
- Allocation: instance
queue
(queue object)
- (
queue
(history-bufferhistory-buffer
)) - (
queue
(packet-bufferpacket-buffer
))
buffer-size
- Value type:
fixnum
- Initial value:
32
- Initargs: buffer-size
- Allocation: instance
- Parameter: t
- Properties: nil
max buffer size in messages
buffer-size
(buffer-size object)
- (
buffer-size
(packet-bufferpacket-buffer
))
buffer-size-bytes
- Value type:
fixnum
- Initial value:
NIL
- Initargs: buffer-size-bytes
- Allocation: instance
- Parameter: t
- Properties: nil
max size in bytes
buffer-size-bytes
(buffer-size-bytes object)
- (
buffer-size-bytes
(packet-bufferpacket buffer
))
byte-length
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
byte-length
(byte-length entity)
Return the length in whole octets (8 bit bytes) of
an entity
. For a packet the length should include the length
of all encapsulated packets together with its overhead.
- (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-gts-request packet))) - (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-ack-packet))) - (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-associate packet))) - (
byte-length
(pktlens.wsn.mac.802.15.4::mac802.15.4-protocol-packet
)) - (
byte-length
(pktlens.wsn.mac.802.15.4::mac802.15.4-beacon-packet
)) - (
byte-length
(mac802.15.4-gts-request-packetlens.wsn.mac.802.15.4::mac802.15.4-gts request-packet
)) - (
byte-length
(mac802.15.4-ack-packetlens.wsn.mac.802.15.4::mac802.15.4-ack-packet
)) - (
byte-length
(mac802.15.4-associate-packetlens.wsn.mac.802.15.4::mac802.15.4-associate packet
)) - (
byte-length
(pktlens.wsn.routing.leach::aggregate-application-packet
)) - (
byte-length
(packetlens.wsn:wsn-packet
)) - (
byte-length
(application-packetlens.wsn:application-packet
)) - (
byte-length
(pktlens.wsn::wireless-signal-end
)) - (
byte-length
(packet-bufferpacket-buffer
)) - (
byte-length
(vbit-vector
))
Indirect Slots
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
name
- Value type:
symbol
- Initial value:
NIL
- Initargs: name
- Allocation: instance
External Class: parameter-class
Inheritance
- Parent classes: standard-class
- Precedence list: parameter-class, standard class, std-class, slot-class, pcl-class, class, dependent-update-mixin, plist-mixin, definition-source-mixin, standard-specializer, specializer, metaobject, standard-object, slot-object, t
- Direct subclasses: module-class
Description
Metaclass for classes which have slots initialised from an external parameter source.
Additional class options
- properties
- an alist
The properties class option specifies the default set of properties all classes of this metaclass will take as a default. These are in addiiton to the instance properties that may be specified. The instance properties take precedence.
Additional slot options
- parameter
- a
boolean
- volatile
- a
boolean
- properties
- an alist
If parameter is true then this is a parameter slot and the value for
this slot will be initialised from the simulation configuration file
as a priority over the default value specified in the :initform
slot
option. If volatile is specified for a parameter slot then the
parameter will be evaluated upon every initialisation allowing random
initialisation for different instances. The properties of a
parameter slot specify additional properties in an alist. By default
the following properties are currently understood.
- format
- specifies a format form to used in parse-input when reading the parameter - overrides the default reading format for the slot type.
Direct Slots
properties
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
The properties for this class
properties
(properties instance)
Return an a-list of properties associated with an instance of a parameter-object. These may be used to specify parameters that may be used outside the simulation itself such as statistics gathers for components or display properties etc. The may be specified on a per class or per instance basis with instance overriding class values.
- (
properties
(objparameter-object
)) - (
properties
(parameter-classparameter-class
))
Indirect Slots
slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
incompatible-superclass-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
can-precede-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cpl-available-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%class-precedence-list
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
%documentation
- Value type:
t
- Initial value:
NIL
- Initargs: documentation
- Allocation: instance
direct-methods
- Value type:
t
- Initial value:
(CONS NIL NIL)
- Initargs: none
- Allocation: instance
direct-subclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
direct-superclasses
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
class-eq-specializer
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
name
- Value type:
t
- Initial value:
NIL
- Initargs: name
- Allocation: instance
source
- Value type:
t
- Initial value:
NIL
- Initargs: definition-source
- Allocation: instance
External Class: parameter-object
Inheritance
- Parent classes: standard-object
- Precedence list: parameter-object, standard object, slot-object, t
- Direct subclasses: packet-buffer, component, simulation
Parameters
None.
Description
Base class for all components which can have slots initialoised from
parameters. See the parameter-class metaclass for the additional
slot options available and their affect. The :properties
initarg
may be used to specify instance specific properties (see
properties).
External Class: simulation
Inheritance
- Parent classes: named-object, parameter object
- Precedence list: simulation, named-object, lens-object, parameter-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- num-rngs
- a
fixnum
. Default:1
. Total number of rngs for this simulation - rng-class
- a
symbol
. Default: ='MT-RANDOM-STATE=. Class for rng's - warmup-period
- a
time-type
. Default:0
. Warmup period for statistics collection - cpu-time-limit
- a
time-type
. Default:300
. Max cpu time for run. - sim-time-limit
- a
time-type
. Default:(* 100 60 60 60)
. Maximum simulation run time - network
- a
symbol
. Specified Network type parameter
Description
The main discrete time event simulation class reads global parameters, creates the network being simulated and manages the queue of events for the simulation.
Direct Slots
clock
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: start-time
- Allocation: instance
Simulation virtual time
halted
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
thread
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Thread running simulation
simulation-thread
(simulation-thread object)
- (
simulation-thread
(simulationsimulation
))
last-schedule-id
event-queue
- Value type:
t
- Initial value: =(MAKE-BINARY-HEAP :INITIAL-SIZE 1024 :EXTEND-SIZE 1.4 :ELEMENT-TYPE 'EVENT :COMP-FN #'EVENT< :INDEX #'EVENT-RANK)=
- Initargs: none
- Allocation: instance
event-queue
(event-queue object)
- (
event-queue
(simulationsimulation
))
configuration
- Value type:
t
- Initial value:
NIL
- Initargs: configuration
- Allocation: instance
Configuration data used for simulation
configuration
(configuration instance)
Return the configuration trie with an instance. By default this will be the configuration read at the start of the simulation.
- (
configuration
(objectt
)) - (
configuration
(instanceowned-object
)) - (
configuration
(simulationsimulation
))
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Top level array of rngs
rng-map
(rng-map context)
- (
rng-map
(componentcomponent
)) - (
rng-map
(simulationsimulation
)) - (
rng-map
(context (eql nil)))
seed-set
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Seed set used in this simulation
seed-set
(seed-set object)
- (
seed-set
(simulationsimulation
))
num-rngs
- Value type:
fixnum
- Initial value:
1
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Total number of rngs for this simulation
num-rngs
(num-rngs object)
- (
num-rngs
(simulationsimulation
))
rng-class
- Value type:
symbol
- Initial value: ='MT-RANDOM-STATE=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
warmup-period
- Value type:
time-type
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Warmup period for statistics collection
warmup-period
(warmup-period object)
- (
warmup-period
(simulationsimulation
))
cpu-time-limit
- Value type:
time-type
- Initial value:
300
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Max cpu time for run.
cpu-time-limit
(cpu-time-limit object)
- (
cpu-time-limit
(simulationsimulation
))
sim-time-limit
- Value type:
time-type
- Initial value:
(* 100 60 60 60)
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Maximum simulation run time
sim-time-limit
(sim-time-limit object)
- (
sim-time-limit
(simulationsimulation
))
network
- Value type:
symbol
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
initialized-p
network-instance
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Actual network instance in this simulation
network
(network object)
- (
network
(nodelens.wsn:node
)) - (
network
(instancet
)) - (
network
(simulationsimulation
))
vector-stream
- Value type:
t
- Initial value:
NIL
- Initargs: vector-stream
- Allocation: instance
Destination stream for vector results
vector-stream
(vector-stream object)
- (
vector-stream
(simulationsimulation
))
scalar-stream
- Value type:
t
- Initial value:
NIL
- Initargs: scalar-stream
- Allocation: instance
Destination stream for scalar results
scalar-stream
(scalar-stream object)
- (
scalar-stream
(simulationsimulation
))
Indirect Slots
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
name
- Value type:
symbol
- Initial value:
NIL
- Initargs: name
- Allocation: instance
External Class: simulation-condition
Inheritance
- Parent classes: condition
- Precedence list: simulation-condition, condition, slot-object, t
- Direct subclasses: None.
Description
Not documented.
External Class: stddev
Inheritance
- Parent classes: scalar-recorder
- Precedence list: stddev, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: histogram, weighted-stddev
Description
Output basic statistics (cound,min,max,mean and stddev) of numeric values received.
Direct Slots
output-format
count
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
result-count
(result-count object)
- (
result-count
(stddevstddev
))
min
- Value type:
float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
max
- Value type:
float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
sum
- Value type:
float
- Initial value:
0
- Initargs: none
- Allocation: instance
sqrsum
- Value type:
float
- Initial value:
0
- Initargs: none
- Allocation: instance
result-sqrsum
(result-sqrsum object)
- (
result-sqrsum
(stddevstddev
))
Indirect Slots
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: sum
Inheritance
- Parent classes: scalar-recorder
- Precedence list: sum, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Record the sum of the numeric values received.
Direct Slots
sum
- Value type:
t
- Initial value:
0
- Initargs: none
- Allocation: instance
recorded-value
(recorded-value scalar-recorder)
Return the value to record for a scalar recorder
- (
recorded-value
(raccumulated-time-recorder
)) - (
recorded-value
(indexed-count-recorderindexed-count-recorder
)) - (
recorded-value
(rtimeavg
)) - (
recorded-value
(last-valuelast-value
)) - (
recorded-value
(recordermean
)) - (
recorded-value
(sumsum
)) - (
recorded-value
(count-recordercount recorder
))
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~A"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: timeavg
Inheritance
- Parent classes: scalar-recorder
- Precedence list: timeavg, scalar-recorder, result-recorder, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Record the time averaged value received.
Direct Slots
start-time
last-time
last-value
- Value type:
real
- Initial value:
0
- Initargs: none
- Allocation: instance
Indirect Slots
output-format
- Value type:
t
- Initial value: ="~A"=
- Initargs: format
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: timer-message
Inheritance
- Parent classes: message
- Precedence list: timer-message, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Class for timer messages. Components which subclass with-timers will receive these messages via handle-timer
Direct Slots
Indirect Slots
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: transmission-channel
Inheritance
- Parent classes: channel
- Precedence list: transmission-channel, channel, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
None.
Description
Base classe for all transmission channels
Direct Slots
Indirect Slots
source-gate
- Value type:
t
- Initial value:
NIL
- Initargs: source-gate
- Allocation: instance
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: unknown-message
Inheritance
- Parent classes: warning
- Precedence list: unknown-message, warning, condition, slot-object, t
- Direct subclasses: None.
Description
Not documented.
External Class: with-timers
Inheritance
- Parent classes: standard-object
- Precedence list: with-timers, standard-object, slot-object, t
- Direct subclasses: wsn-module
Description
Mixin class with dynamic timer handling. See set-timer, handle-timer and cancel-timer for additional functionality provided for this class.
3.3.2 External Structures
External Structure: channel-result
Slots
- delay
- The propagation delay of the channel
- duration
- The transmition duration of the packet.
- discard
- If true packet packet will be discarded (was lost in transmission)
Description
Structure containg result of process-message from a channel
Slots
duration
External Structure: coord
Description
A spatial coordinate
External Structure: message-sent-signal-value
Slots
- timestamp
- a time-type - the time message was sent
- message
- a message being sent.
- result
- a channel-result
Description
Structure used to to pass information on message-sent
signal
conataining the time it was sent, the message and the channel result.
Slots
timestamp
External Structure: timestamped
Slots
- time
- a time-type (default simulation-time)
- value
- a value
Description
Structure associating a time with a value.
External Structure: timestamped-queue
Description
A timestamped queue records the simulation time of when items are enqueued. dequeue and peek from a timestamped-queue returns this time as a second value. The timestamped-queue also keeps track of the average queue duration which can be obtained using average-queue-time.
3.3.3 External Types
External Type: time-type
Not documented.
3.3.4 External Constants
External Constant: +c+
Value
2.99792458d8
Type: double-float
Description
Speed of Light in m/sec
3.3.5 External Global Variables
External Variable: *context*
Value
NIL
Type: null
Description
Current global component context in which evaluation is taking place. It is used to determine mapping for random number streams and for providing tracing context. This should be bound for the extent of exposed interfaces to components. The kernel binds it around the handle-message and initialize methods.
External Variable: *simulation-init-hooks*
Value
(ADD-STATISTICS)
Type: cons
External Variable: *simulation-trace-stream*
Value
#<SWANK-BACKEND::SLIME-OUTPUT-STREAM {BCDD449}>
Type: slime-output-stream
Description
The stream on which tracing information (using tracelog) is to be written.
External Variable: *time-format*
Value
"~7/lens::sec/"
Type: simple-array
External Variable: network
Value
NIL
Type: null
Description
Network name for current run
3.3.6 External Macros
External Macro: define-statistic-filter
Syntax
(define-statistic-filter name (var &rest statevars) &body body)
Arguments
- name
- a
symbol
(evaluated) - var
- a
symbol
(evaluated) - statevars
- a binding form*
- body
- form*
Description
Define and register a statistic filter function. var is the name used in body to refer to the input value. statevars are the state value definitions as per let which are bound outside the finction. body must return the filter value or null to abort filtering.
External Macro: filter
Syntax
(filter test lst &key (key '#'identity))
Arguments
- test
- a designator for a function of one argument which returns a generalised boolean
- lst
- a proper list
- key
- a designator for a function of one argument
Returns
- result
- a list
External Macro: for
Syntax
(for (var start stop)
&body
body)
Arguments
- var
- a variable name (not evaluated)
- start
- an integer (evaluated)
- stop
- an integer (evaluated)
- body
- a list of forms
External Macro: tracelog
Syntax
(tracelog &rest args)
Rest Arguments
- args
- list of format arguments.
Description
Write to simulation-trace-stream using args provided the collect-trace-info parameter for the current context is true.
This is designed to enable efficient configuration file controlled tracing of simulation execution.
External Macro: until
Syntax
(until test
&body
body)
External Macro: while
Syntax
(while test &body body)
Description
A while loop - repeat body while test is true
3.3.7 External Functions
External Function: <=
Syntax
(<= number &rest more-numbers)
External Function: <=
Syntax
(<= number &rest more-numbers)
External Function: arrival-time
Syntax
(arrival-time event)
External Function: arrived
Syntax
(arrived module message gate arrival-time)
Arguments
*Description
Called when the message arrives at the gate which is not further connected (that is, next-gate is NULL) of of module. arrival-time is when the message is to be delivered.
The default implementation will fill in the arrival gate details in the message and schedule it for delivery at the arrival-time. Packets will be schedule at the arrival-time + their duration unless deliver-on-reception-start-p is set true for the gate in which case they will the reception-start-p will be set true for the packet and they will be delivered at arrival-time.
External Function: average-queue-time
Syntax
(average-queue-time queue)
Arguments
- queue
- a timestamped-queue
External Function: bernoulli
Syntax
(bernoulli p &optional (rng 0))
Arguments
- p
- an
integer
Optional Arguments
- rng
- an
integer
(default 0)
External Function: beta
Syntax
(beta alpha1 alpha2 &optional (rng 0))
Arguments
- alpha1
- a positive
real
number - alpha2
- a positive
real
number
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random variate from the beta distribution with parameters alpha1, alpha2 from the random number stream rng in the current context.
Generation is using relationship to Gamma distribution (see gamma-d): if Y1 has gamma distribution with alpha=alpha1 and beta=1 and Y2 has gamma distribution with alpha=alpha2 and beta=2, then Y = Y1/(Y1+Y2) has beta distribution with parameters alpha1 and alpha2.
External Function: binomial
Syntax
(binomial n p &optional (rng 0))
Arguments
- n
- an
integer
n>0 - p
- an
integer
0<=p<=1
Optional Arguments
- rng
- an
integer
(default 0)
Description
Return a random integer from the binomial distribution with parameters n and p, that is, the number of successes in n independent trials with probability p using the random number stream rng in the current context.
Generation is using the relationship to Bernoulli distribution (runtime is proportional to n).
External Function: bit-length
Syntax
(bit-length entity)
Description
Return the length in bits of an entity
. This is
the byte-length * 8 for most entities, but is the actual length
of a bit-vector
which may be used to represent bit fields.
External Function: build-connections
Syntax
(build-connections module)
Arguments
- module
- a compound-module
External Function: build-gates
Syntax
(build-gates module)
Arguments
- module
- a module
Description
Build the module gates on the basis of the gate specification from the
:gates
argument in the module-class specification.
This method is called during a module instance initialisation.
External Function: build-inside
Syntax
(build-inside module)
Arguments
- module
- a module
Description
Build the the submodules (calling build-submodules) of
compound-module module as per the :submodules
class argument and
connect them (calling build-connections as per the
:connections
class argument.
This method is recursively called upon network creation.
External Function: build-submodules
Syntax
(build-submodules module)
Arguments
- module
- a compound-module
Description
Build the submodules inside a compound-module
as per the :submodules
class argument. This may be specialised
usefully to add in additional submodule creation algoritmically.
External Function: busy-p
Syntax
(busy-p channel)
Arguments
- channel
- a transmission-channel
Returns
- busy
- a
boolean
Description
For transmission channels: returns whether the sender gate is currently transmitting, ie. whether transmission-finish-time is greater than the current simulation time.
External Function: byte-length
Syntax
(byte-length entity)
Description
Return the length in whole octets (8 bit bytes) of
an entity
. For a packet the length should include the length
of all encapsulated packets together with its overhead.
External Function: calculate-duration
Syntax
(calculate-duration channel message)
Arguments
- channel
- a transmission-channel
- message
- a message
Returns
- duration
- a time-type
Description
Calculates the transmission duration of the message with the current transmission channel configuration (datarate, etc); it does not check or modify channel state. For non-transmission channels this method returns zero.
This method is useful for transmitter modules that need to determine the transmission time of a packet without actually sending the packet.
Caveats: this method is best-effort – there is no guarantee that transmission time when the packet is actually sent will be the same as the value returned by this method. The difference may be caused by changed channel parameters (i.e. datarate being overwritten), or by a non-time-invariant transmission algorithm.
Note that there is no requirement that method process-message relies on this method to calculated the packet duration. That is, to change the duration computation algorithm via subclassing you need to redefine both process-message and calculate-duration.
External Function: cancel-timer
Syntax
(cancel-timer module timer)
Arguments
- module
- an instance of with-timers
- timer
- a timer designator (either
symbol
or timer-message)
Description
Cancel an already schedule timer designated by timer associated with module. If the associated timer-message was created when scheduled set-timer it will be deleted at this point.
External Function: cauchy
Syntax
(cauchy a b &optional (rng 0))
Arguments
- a
- a real
- b
- a positive real
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random variate from the Cauchy distribution (also called Lorentzian distribution) with parameters a,b where b>0 using the random number stream rng in the current context.
This is a continuous distribution describing resonance behavior. It also describes the distribution of horizontal distances at which a line segment tilted at a random angle cuts the x-axis.
Generation uses the inverse transform.
External Function: chi-square
Syntax
(chi-square k &optional (rng 0))
Arguments
- k
- a positive integer
Optional Arguments
- rng
- an
integer
(default 0)
Returns a random variate from the chi-square distribution with k degrees of freedom using the random number stream rng in the current context.
The chi-square distribution arises in statistics. If Y_i are k independent random variates from the normal distribution with unit variance, then the sum-of-squares (sum(Y_i^2)) has a chi-square distribution with k degrees of freedom.
The expected value of this distribution is k. Chi_square with parameter k is gamma-distributed with /alpha/=/k//2, /beta/=2.
Generation is using relationship to gamma distribution (see gamma-d).
External Function: configuration
Syntax
(configuration instance)
External Function: configure
Syntax
(configure instance)
External Function: connect
Syntax
(connect from-gate to-gate &key channel leave-uninitialized)
Description
Connects the gate to another gate, using the given channel object (if one is specified). This method can be used to manually create connections for dynamically created modules.
This method invokes initialize on the channel object, unless the compound module containing this connection is not yet initialized (then it assumes that this channel will be initialized as part of the compound module initialization process.) To leave the channel uninitialized, specify true for the leave-uninitialized parameter.
If the gate is already connected, an error will occur. The gate argument cannot be nil, that is, you cannot use this function to disconnect a gate; use disconnect for that.
Simulation Events
- pre-model-change
- a
list
. Emitted before the gate is connected - post-model-change
- a
list
. Emitted after the gate is connected.
Model change events are emiited with a list describing the change. This list has a descriptive symbol followed by keyword arguments of the elements involved in the change. connect provides the following model change notifications.
- gate-connect-notification
- signalled in the module containing this gate
- path-create-notification
- signalled to the start and end modules of path
External Function: connected-outside-p
Syntax
(connected-outside-p gate)
External Function: coord*
Syntax
(coord* a b)
Description
Return element wise (scalar) multiplation of coords a and b.
External Function: coord+
Syntax
(coord+ a b)
External Function: coord-op
Syntax
(coord-op op &rest coords)
External Function: coord-x
Syntax
(coord-x instance)
External Function: coord-y
Syntax
(coord-y instance)
External Function: coord-z
Syntax
(coord-z instance)
External Function: copy-slots
Syntax
(copy-slots slots source destination)
Arguments
- slots
- a list of slot names
- source
- a class instance
- destination
- a class instance
Returns
- destination
- a class instance
External Function: cumulative-density-function
Syntax
(cumulative-density-function instance x)
External Function: decapsulate
Syntax
(decapsulate packet)
External Function: define-result-recorder
Syntax
(define-result-recorder classname &optional (name classname))
Arguments
- classname
- a
symbol
- name
- a
symbol
External Function: deliver
Syntax
(deliver message gate time)
External Function: deliver-on-reception-start-p
Syntax
(deliver-on-reception-start-p object)
External Function: detailed-info
Syntax
(detailed-info o)
External Function: disconnect
Syntax
(disconnect gate)
Description
Disconnects the gate, and also deletes the associated channel object if one has been set. disconnect() must be invoked on the source gate (from side) of the connection. The method has no effect if the gate is not connected.
Simulation Events
- pre-model-change
- a
list
. Emitted before the gate is disconnected - post-model-change
- a
list
. Emitted after the gate is disconnected.
Model change events are emiited with a list describing the change. This list has a descriptive symbol followed by keyword arguments of the elements involved in the change. disconnect provides the following model change notifications.
- gate-disconnect-notification
- signalled in the module containing this gate
- path-cut-notification
- signalled to the start and end modules of path
External Function: distance
Syntax
(distance a b)
External Function: do-histogram
Syntax
(do-histogram values &key (min -1) (max 1) (n 10))
External Function: duplicate
Syntax
(duplicate object &optional duplicate)
Description
Should be redefined in subclasses to create an exact copy of this object. The default implementation just throws an error, to indicate that the method was not redefined. The second argument, if defined should be the instance that the object is being duplicated into. By default this will be a new instance of the same class as the object to be duplicated.
For packets this does a shallow copy i.e. copies fields only and does not recurse into the encapsulated packets.
External Function: duplicate-p
Syntax
(duplicate-p entity buffer &optional record)
Arguments
- entity
- an object
- buffer
- a history-buffer
Optional Arguments
- record
- a
boolean
(default t)
External Function: emit
Syntax
(emit entity signal &optional value)
Arguments
- entity
- an entity-with-signals
- signal-id
- a signal identifier
Optional Arguments
- value
- a value
Description
Emit the optional value with a signal. If the given signal has listeners in this component entity or in it's ancestor components, their appropriate receive-signal methods get called.
External Function: encapsulate
Syntax
(encapsulate packet packet-to-be-encapsulated)
External Function: erlang-k
Syntax
(erlang-k k m &optional (rng 0))
Arguments
- k
- a positive integer
- m
- a positive
real
number
Optional Arguments
- rng
- an
integer
(default 0)
Returns a random variate from the Erlang distribution with k phases and mean m using the random number stream rng in the current context.
This is the sum of k mutually independent random variables, each with exponential distribution. Thus, the /k/th arrival time in the Poisson process follows the Erlang distribution.
Erlang with parameters m and /k. is gamma-distributed (see gamma-d with alpha/=/k and beta/=/m / k.
Generation makes use of the fact that exponential distributions sum up to Erlang.
External Function: exponential
Syntax
(exponential mean &optional (rng 0))
Arguments
- mean
- a
real
number
Optional Arguments
- rng
- an
integer
(default 0)
External Function: find-object
Syntax
(find-object parent name &optional deep)
Description
Finds the object with the given name. This function is useful when called on subclasses that are containers. This method finds the object with the given name in a container object and returns a pointer to it or NULL if the object has not been found. If deep is false, only objects directly contained will be searched, otherwise the function searches the whole subtree for the object. It uses the for-each-child mechanism.
External Function: for-each-channel
Syntax
(for-each-channel module operator)
External Function: for-each-child
Syntax
(for-each-child parent operator)
Description
Enables traversing the object tree, performing some operation on each object. Tyhe default module and compound-module provide implementations that will recurse over gates, submodules and channels if stored in the usual way. Implementations may wish to overwrite if storing some subelements that may be considered as children differently.
External Function: for-each-submodule
Syntax
(for-each-submodule module operator)
Arguments
- module
- a module
- operator
- a
function
Description
Applies operator over each submodule of a module.
Objects with submodules must provide this to iterate over submodules. module and compound-module classes provide implementations automatically however if additional submodules beyond those specified in the class are created it may be necessary to specialise this function to include them..
External Function: format-from-type
Syntax
(format-from-type type)
Description
Given a type declaration return a format declaration suitable for use in parse-input to covert a parameter string to internal representation.
External Function: full-name
Syntax
(full-name o)
External Function: full-path
Syntax
(full-path o)
Description
Returns the full path of the object in the object hierarchy, like '(net host 2 tcp winsize)'. This path could be used as an address to locate the object later in the network.
If there is an owner object, this method returns the owner's full-path with this object's full-name appended, otherwise it simply returns full-name.
External Function: gamma-d
Syntax
(gamma-d alpha theta &optional (rng 0))
Arguments
- alpha
- a positive
real
number - theta
- a positive
real
number
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random variate from the gamma distribution with parameters alpha/>0, /theta/>0 from the random number stream /rng in the current context. alpha is known as the shape parameter, and theta as the scale parameter.
Some sources in the literature use the inverse scale parameter beta = 1 / theta, called the rate parameter. Various other notations can be found in the literature; our usage of (alpha,theta) is consistent with Wikipedia and Mathematica (Wolfram Research).
Gamma is the generalization of the Erlang distribution for non-integer k values, which becomes the alpha parameter. The chi-square distribution is a special case of the gamma distribution.
For alpha/=1, Gamma becomes the exponential distribution with /mean/=/theta.
The mean of this distribution is alpha*theta, and variance is /alpha*theta/^2.
Generation: if /alpha/=1, it is generated as exponential(theta).
For alpha>1, we make use of the acceptance-rejection method in "A Simple Method for Generating Gamma Variables, George Marsaglia and Wai Wan Tsang", ACM Transactions on Mathematical Software, Vol. 26, No. 3, September 2000.
The alpha<1 case makes use of the alpha>1 algorithm, as suggested by the above paper.
External Function: gate
Syntax
(gate entity address &key index &allow-other-keys)
External Function: gate-direction
Syntax
(gate-direction gate)
External Function: gate-extend
Syntax
(gate-extend gate-slot)
External Function: gate-type
Syntax
(gate-type gate-slot)
External Function: geometric
Syntax
(geometric p &optional (rng 0))
Arguments
- p
- an
integer
p>0
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random integer from the geometric distribution with parameter p. That is, the number of independent trials with probability p until the first success. Uses the random number stream rng in the current context.
This is the n=1 special case of the negative binomial distribution.
Generation uses inverse transform.
External Function: handle-message
Syntax
(handle-message entity message)
Description
handle-message is the main processing method for modules and protocols in which they receive messages. It must be implemented for all simple modules to implement their protocols. It may usefully implemented in compound-modules if they have input gates not connected to submodules however this is not normally expected.
External Function: handle-timer
Syntax
(handle-timer module timer-name)
Arguments
- module
- an instance of with-timers
- timer-name
- a
symbol
External Function: has-listeners
Syntax
(has-listeners entity signal)
Arguments
- entity
- an entity-with-signals
- signal-id
symbol
signal identifier
Description
Return true if entity has any listeners for signal designated by signal-id.
For some signals this method has a significant overhead (linear to the number of hierarchy levels in the network). may-have-listeners may be more appropriate in most cases.
External Function: info
Syntax
(info o)
External Function: initialize
Syntax
(initialize component &optional stage)
Arguments
- component
- a simulation component
- stage
- a positive
integer
Return
- finished
- a boolean
Description
This method is called for every comonent in the simulation after the whole simulation is created but before the first event is executed. It allows depth-first staged initialization and configuration for components which may depend on other components having being created. It will be called multiple times with stage increasing by 1 (from an initial value of 0) every time until it returns finished as true. This allows for multiple stage initialisation between codependent object types. Implementations should therefore check the stage value to insure they don't initialise more than once. An object is only deemed to be initialised once it initialize method and the intialize method of all subcomponents return true.
list method combination is used so that when subclassing all the relevant initialize methods must return true for the effective method to return true.
External Function: initialized-p
Syntax
(initialized-p component)
Arguments
- component
- a simulation component
Description
Returns true if an entity has finished its initialization using the initialize method.
External Function: intuniform
Syntax
(intuniform a b &optional (rng 0))
Arguments
- a
- an
integer
- b
- an
integer
Optional Arguments
- rng
- an
integer
(default 0)
External Function: latency
Syntax
(latency entity)
Arguments
- entity
- an object
Description
Return the latency of the packet or timestampted entity - the time difference between current simulation-time and the time the rntity was timestamped.
External Function: listeners
Syntax
(listeners entity signal)
Arguments
- entity
- a entity-with-signals
- signal
- a
symbol
ort
External Function: lognormal
Syntax
(lognormal m w &optional (rng 0))
Arguments
- m
- a
real
number - w
- a
real
number
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random variate from the lognormal distribution with scale parameter m and shape parameter w from the random number stream rng in the current context. m and w correspond to the parameters of the underlying normal distribution (m: mean,/w/: standard deviation.)
External Function: make-coord
Syntax
(make-coord &optional (x 0.0) (y 0.0) (z 0.0))
External Function: may-have-listeners
Syntax
(may-have-listeners entity signal-id)
Arguments
- entity
- an entity-with-signals
- signal-id
- a positive
integer
orsymbol
signal identifier
Description
Return true if entity may have listeners for signal signal-id. That is if the corresponding signal has local or ancestor listeners according to the entity cache/ or the signal is outside the cache range.
It is intented that this is an efficient check that may be used to eliminate uneccessary calculations of values and calls to emit.
External Function: message-sent-signal-value-message
Syntax
(message-sent-signal-value-message instance)
External Function: message-sent-signal-value-result
Syntax
(message-sent-signal-value-result instance)
External Function: message-sent-signal-value-timestamp
Syntax
(message-sent-signal-value-timestamp instance)
External Function: negbinomial
Syntax
(negbinomial n p &optional (rng 0))
Arguments
- n
- an
integer
n>0 - p
- an
integer
0<=p<=1
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random integer from the negative binomial distribution with parameters n and p, that is, the number of failures occurring before n successes in independent trials with probability p of success. Uses the random number stream rng in the current context.
Generation is using the relationship to geometric distribution (runtime is proportional to n).
External Function: nominal-datarate
Syntax
(nominal-datarate channel)
Arguments
- channel
- a class transmission-channel
Returns
- nominal-datarate
- a
number
, bits per second
Description
Returns the nominal data rate of the channel in bits per second (bps). The number returned from this method should be treated as informative; there is no strict requirement that the channel calculates packet duration by dividing the packet length by the nominal data rate. For example, specialized channels may add the length of a lead-in signal to the duration.
External Function: normal
Syntax
(normal &optional (mean 0.0d0) (stddev 1.0d0) (rng 0))
Optional Arguments
- mean
- a
real
number (default 0) - stddev
- a
real
number (default 1d0) - rng
- an
integer
(default 0)
External Function: parent-module
Syntax
(parent-module object)
External Function: pareto-shifted
Syntax
(pareto-shifted a b c &optional (rng 0))
Arguments
- a
- a real
- b
- a real
- c
- a real
Optional Arguments
- rng
- an
integer
(default 0)
External Function: path-end-gate
Syntax
(path-end-gate gate)
External Function: path-start-gate
Syntax
(path-start-gate gate)
External Function: peek
Syntax
(peek s)
External Function: poisson
Syntax
(poisson lambda &optional (rng 0))
Arguments
- lambda
- an
integer
lambda>0
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random integer from the Poisson distribution with parameter lambda, that is, the number of arrivals over unit time where the time between successive arrivals follow exponential distribution with parameter lambda. Uses the random number stream rng in the current context.
lambda is also the mean (and variance) of the distribution.
Generation method depends on value of lambda:
- 0</lambda/<=30: count number of events lambda>30:
- Acceptance-Rejection due to Atkinson (see Banks, page 166)
External Function: probability-density-function
Syntax
(probability-density-function instance x)
External Function: process-message
Syntax
(process-message channel message time)
Arguments
- channel
- an instance of class channel
- message
- the class message to be processed
- time
- time-type the time message is to be processed
Returns
- channel-result
- a structure channel-result
Description
This method encapsulates the channel's functionality. The method should model the transmission of the given message starting at the given time, and return the propagation delay, transmission duration, and discard flag in the channel-result object.
Transmission duration and bit error modeling only applies to packets i.e. to instances of class packet, it should be skipped for non-packet messages. The method does not need to set the duration of the packet; this is done by the simulation kernel. However, the method should call function (setf bit-error) on the packet if error modeling results in bit errors.
If the method sets the discard flag in the result object, it means that the message object should be deleted by the simulation kernel; this facility can be used to model that the message gets lost in the channel.
The method does not need to throw errors on overlapping transmissions, or if the packet's duration field is already set; these checks are done before process-message is called.
Simulation Events
- message-discarded
- structure timestamped with message as value should be emited if the class message is being discarded
- message-sent
- structure message-sent-signal-value should be emitted if message is successfully delivered with both the class message and structure channel-result objects.
See also
External Function: property-union
Syntax
(property-union list1 list2)
Arguments
- list1
- a property list
- list2
- a property list
Returns
- list
- a property list
External Function: rand
Syntax
(rand stream &optional limit)
Arguments
- stream
- a random number sequence stream
Optional Arguments
- limit
- a real (default 1.0)
Description
Return a random number x of same type as limit from a random number sequence stream in the range 0<= x <= limit . See also randExc
External Function: range-getf
Syntax
(range-getf spec index)
Arguments
- spec
- a range property list
- index
- a number
Results
- result
- a value corresponding to
index
inspec
ornil
if no match - index
- the lower index of range corresponding to match
Description
Range property lists are plists where the property indicator is either a number indicating a single value or a cons of a lower and upper range.
range-getf finds the property in spec
that either === the index
or where=index= lies between the upper and lower bound of the specified range.
Property ranges are typically used to specify parameters that vary depending on an index.
External Function: range-list-p
Syntax
(range-list-p spec)
Description
Return true if spec
is a valid range property list.
See Also
External Function: read-configuration
Syntax
(read-configuration pathname &optional (key general))
Arguments
- pathname
- a path designator for a a configuration file
- key
- string or list of strings designating sections (default "General")
Returns
- trie
- A trie containing configuration
Description
This functions reads the configuration keys from a source file
designated by pathname
one or more sections designated by key
and
returns a trie containing the fully resolved
configuration. Configuration files are used to specify the parameters
for the simulation and the heirachy of components therein.
If a list of sections is given in key
they are read in the specified order.
If the "General" section is not listed it will be read at the end.
Configuration File Format
The configuration data have the following syntax.
- comments
- #<comment>
- section
- [<section-title>]
- file-inclusion
- include <path>
- parameter-definition
- <parameter-name> = <parameter-value>
- parameter-name
- (<name-part>.*)<name-part>
- name-part
- <name>|<glob>|<index>
- glob
- <*>|<**>
- index
- <integer> | <range>
- name
- <character>+
- range
- <integer>-<integer>
Configuration data is read line per line. Everything after # on a line is considered a comment. If a line ends with a #\ it is assumed the following line is a continuation line. All parameters are read into named sections designated by the previous <section> or "General" section if no previous section title is given.
<file-inclusion> is used to insert the contents of another file at the given point. It is exactly as if the lines from that file where inserted at that point.
The <parameter-name> is used to specify which durind simulation Parameters for the simulation have heirarchical names which correspond to the heirarchy of named components in the simulation. Globs may be used to specify an any match. * corresponds to matching a single paramater-name whereas ** will match a sequence of names in the heirarchy. For indexed components the index may either be a single integer or a range of values seperated with -.
External Function: read-parameter
Syntax
(read-parameter full-path source format)
Description
Loopup a fully named parameter from a configuration trie and convert from string to internal representation using parse-input with the specified format. If the format is a pathname it may be relative to the path of the source file from which the parameter was read.
External Function: receive-signal
Syntax
(receive-signal listener signal source value)
Arguments
- listener
- an entity-with-signals instance.
- signal
- a signal designator (
symbol
orinteger
) - source
- an entity-with-signals instance.
- value
- signalled value
Description
A call of emit with signal value signal from [entity-with-signals]] object/source/ and value value will result in receive-signal being called in the source object and all ancestor objects in the simulation heirarchy that have registered to receive this signal using subscribe
All objects which wish to receive signals must specialise this method.
External Function: record
Syntax
(record recorder time value)
Arguments
- recorder
- a result-recorder
- time
- a time-type
- value
- a
number
Description
Must be specialised for all result-recorder classes to record the value at simulation time time. value will usually be a number but could be a structure containing more information or treated as a boolean for simple counting recorders.
External Function: register-signal
Syntax
(register-signal symbol &optional documentation)
Description
*Arguments
- symbol
- a
symbol
Optional Arguments
- documentation
- a
string
Returns
- signal-id
- an
integer
Description
Register signal denoted by symbol and optionally recording the
documentation. If the named signal has not previously been
registered it will be allocated a new integer signal-id stored in
the signal-id
property of the symbol and it will be added onto the
end of the global signals array. documentation is stored in
the signal-doc
symbol.
register-signal is intended to be called as a top level form.
The first signal-cache-size signals registered are cached by entity-with-signals objects and therefore the signals which are most heavily used should be registered first when loading the simulation code.
External Function: reinitialise-slots
Syntax
(reinitialise-slots slot-names instance)
Arguments
- slots-names
- a list of slot names
- source
- a class instance
External Function: repair-signal-flags
Syntax
(repair-signal-flags component)
Arguments
- component
- an entity-with-signals
External Function: report
Syntax
(report recorder stream)
Arguments
- recorder
- a result-recorder
- stream
- a stream-designator
Description
Must be specialised for all result-recorder classes to report the statistic value to stream. Defined for the scalar-recorder class to output the value returned from recorded-value using the output-format format string and for vector-recorder to output the vector returned from recorded-vector at full precision.
Notes
The finish method will be called on the result-recorder in order for it to complete its statistics analysis at the simulation termination time beforer any calls to report
External Function: run-simulations
Syntax
(run-simulations pathname &key (config general) (repeat 1) runnumber preview)
Arguments
- pathname
- a path designator
Keyword Arguments
- config
- a
string
or list of strings (default "General") - repeat
- an
integer
>= 1 (default 1) - runnumber
- an
integer
>= 1 - preview
- a
boolean
Description
Executes one or more simulations using the configuration file at pathname. config lists one or more sections of the configuration file to use for this run. They will be loaded in order and the "General" section will always be read last. repeat specifies how many times to run the simulation. Each run will be with different seed parameters of the random number generators. If runnumber is specified then it specifies a single run within a sequence if the configuration file specifies iteration over some parameters. If preview is true simulations are not run but onfiguration parameters for each run are printed out.
External Function: schedule
Syntax
(schedule event &key delay time)
Arguments
- event
- and event
Keyword Arguments
- delay
- a positive
real
- time
- a positive
real
Description
Schedule event to be handled at the given simulation time time or delay after current simulation time. If no delay or time is provided the arrival-time value of the event is used. The scheduled time must be >= current simulation-time i.e. in the future.
External Function: schedule-at
Syntax
(schedule-at module message &key time delay)
Description
Schedule a self-message. The message will be delivered back to module via handle-message either at absolute simulation time time or after delay delay which will be added onto the current simulation time. This function is the way you can implement timers or timeouts. Timers can also be cancelled via cancel. When the message is delivered at the module, you can call self-message to tell it apart from messages arriving from other modules.
cancel can be used to cancel the self-message before it arrives. This is useful for implementing timeouts: if the event occurs 'in time' (before timeout), the scheduled self-message can be cancelled.
Given a message you can check whether it is currently scheduled by calling scheduled-p. If it is scheduled, you cannot schedule it again without calling cancel first. However, after the message was delivered to the module or cancelled, you can schedule it again – so you can reuse the same message object for timeouts over and over during the whole simulation.
- Notes
The preferred way of implementing timers is now provided using timer-messages, set-timer and cancel-timer.
External Function: sec
Syntax
(sec stream arg &optional colon-p at-p (d 3) (padchar ) (exponentchar e))
Arguments
- stream
- An output stream designator.
- arg
- time format argument
- colon-p
- ignored
- at-p
- ignored
- D
- number of digits to print after decimal point
- padchar
- character to print leading the output
- exponentchar
- character to print before exponent.
Description
Simulation Time formatter function outputs a time argument arg
to stream
in engineering format.
Example
(format nil "~3/lens:sec/" 0.5689) => "568.900ms"
See also
External Function: seed
Syntax
(seed stream seed)
External Function: send
Syntax
(send module message gateid &key delay)
Arguments
Description
Schedule sending message through the specified gate of given module after given delay. The delay is added onto the current simulation-time to determine delivery time and the source gate of the message will be sent. deliver is called to actually schedule the message.
External Function: send-direct
Syntax
(send-direct module togate message &key propagation-delay duration)
Description
Send message directly to the togate gate of another module.
If the target togate is further connected the message will follow the connections that start at that gate. For example, when sending to an input gate of a compound-module, the message will follow the connections inside the compound module.
It is permitted to send to an output gate, which will also cause the message to follow the connections starting at that gate. This can be useful, for example, when several submodules are sending to a single output gate of their parent module.
It is not noramlly permitted to send to a gate of a compound-module which is not further connected unless function handle-message has been specialised for that compound-module class.
Also, it is not permitted to send to a gate which is otherwise connected i.e. which has a previous-gate. This means that modules must have dedicated gates for receiving via send-direct. You cannot have a gate which receives messages via both connections and send-direct.
When a nonzero duration is given, that signifies the duration of the packet transmission, that is, the time difference between the transmission (or reception) of the start of the packet and that of the end of the packet. The destination module can choose whether it wants the simulation kernel to deliver the packet object to it at the start or at the end of the reception. The default is the latter; the module can change it by calling deliver-on-reception-start on the final input gate (that is the path-end-gate). deliver-on-reception-start needs to be called in advance, for example in the initialize method of the module. When a module receives a packet, it can call the reception-start-p and [duration]] methods on the packet to find out whether it represents the start or the end of the reception, and the duration of the transmission.
For messages that are not packets the duration must be zero.
External Function: serialise
Syntax
(serialise o stream)
External Function: set-slots
Syntax
(set-slots instance defs)
Arguments
- instance
- a class instance
- defs
- a list of lists
External Function: set-timer
Syntax
(set-timer module timer interval &optional timer-name)
Arguments
- module
- an instance of with-timers
- timer
- a timer designator (either
symbol
or timer-message) - interval
- a [time-type]]
Optional Arguments
- timer-name
- a
symbol
Description
Schedule a timer designated by timer to be fired after simulation interval interval. handle-message will be called after interval with the module and timer-name as its arguments. If timer is a timer-message it will be givne the name timer-name.
If a timer designated by timer already exists it will be cancelled
and rescheduled otherwise a new timer-message will be created with
the given name and added onto the timers
slot list of module.
For efficiency if classes have a slot with slot-name timer-name it is assumed that this will contain the timer-message to be used. In this case the slot definition should definine (make-instance 'timer-message) as the initform.
External Function: signal-id
Syntax
(signal-id symbol)
External Function: simulation-time
Syntax
(simulation-time &optional (simulation *simulation*))
External Function: size
Syntax
(size s)
External Function: stop
Syntax
(stop simulation &key abort)
Arguments
- simulation
- a simulation object
Keyword Arguments
- abort
- a
boolean
Description
Stop the simulation. If abort is teu this will stop immediately by killing the thread in which the simulation is running otherwise it will stop after it has finished processing the current even.
External Function: student-t
Syntax
(student-t i &optional (rng 0))
Arguments
- i
- a positive integer
Optional Arguments
- rng
- an
integer
(default 0)
Returns a random variate from the student-t distribution with i degrees of freedom using the random number stream rng in the current context.
If Y1 has a normal distribution and Y2 has a chi-square distribution with k degrees of freedom then X = Y1 / sqrt(Y2/k) has a student-t distribution with k degrees of freedom.
Generation is using relationship to gamma and chi-square.
External Function: submodule
Syntax
(submodule module address &key index)
Arguments
- module
- a module
- address
- a submodule-specifier
- submodule-specifier : ( (submodule-name | ( submodule-name index))*)
- submodule-name : a
symbol
- index L an
integer
Description
Return the submodule of a module given a heirarchical address. This will recurse throguh the submodule structure in order if the address is a list of submodules names. At each stage the submodule name or the name and index are used to recurse further down. It will return an error if there is no such named submodule.
External Function: subscribe
Syntax
(subscribe entity signal listener)
Arguments
- entity
- an entity-with-signals
- signal-id
symbol
signal identifier- listener
- an object
Description
Adds a listener (callback object) that will be notified using the receive signal method when the given signal is emitted (see emit methods). It is an error to subscribe the same listener twice to the same signal. The order in which listeners will be notified is undefined.
External Function: subscribed-p
Syntax
(subscribed-p entity signal listener)
Arguments
- entity
- an entity-with-signals
- signal-id
symbol
signal identifier- listener
- an object
Description
Removes the given listener from the subscription list for signal designated by signal-id in entity . It has no effect if the given listener was not subscribed using subscribe.
Returns true if the given listener is subscribed to the signal designated by signal-id at entity component (i.e. it does not look at listeners subscribed at ancestor components).
External Function: timer
Syntax
(timer module name)
Arguments
- module
- an instance of with-timers
- name
- a
symbol
External Function: timestamped-value
Syntax
(timestamped-value instance)
External Function: title
Syntax
(title instance)
Arguments
- instance
- a statistic-listener
Description
Return the publishable title for a result from a statistic-listener. Declared in the arguments to the :statistic
property of a component.
External Function: transmission-channel
Syntax
(transmission-channel gate &optional incoming-p)
Description
Typically invoked on an output gate, this method returns the channel in the connection path that supports datarate (as determined; it is guaranteed that there can be at most one such channel per path). If there is no such channel, nil is returned. If incoming-p is true looks for an incoming channel - else returns the outgoing channel.
External Function: transmission-finish-time
Syntax
(transmission-finish-time channel)
Arguments
- channel
- a transmission-channel
Returns
- duration
- a time-type
External Function: triang
Syntax
(triang a b c &optional (rng 0))
Arguments
- a
- a real
- b
- a real
- c
- a real
Optional Arguments
- rng
- an
integer
(default 0)
External Function: truncnormal
Syntax
(truncnormal &optional (m 0.0d0) (d 1.0d0) (rng 0))
Optional Arguments
- m
- a
real
number (default 0d0) - d
- a
real
number (default 1d0) - rng
- an
integer
(default 0)
Description
Return the Normal distribution (from normal truncated to nonnegative values from the random number stream rng in the current context.
It is implemented with a loop that discards negative values until a nonnegative one comes. This means that the execution time is not bounded: a large negative mean with much smaller stddev is likely to result in a large number of iterations.
The mean and stddev parameters m and d serve as parameters to the normal distribution before truncation. The actual random variate returned will have a different mean and standard deviation.
External Function: uniform
Syntax
(uniform a b &optional (rng 0))
Arguments
- a
- a
real
number - b
- a
real
number
Optional Arguments
- rng
- an
integer
(default 0)
External Function: unsubscribe
Syntax
(unsubscribe entity signal listener)
Arguments
- entity
- an entity-with-signals
- signal-id
symbol
signal identifier- listener
- an object
Description
Removes the given listener from the subscription list for signal designated by signal-id in entity . It has no effect if the given listener was not subscribed using subscribe.
External Function: urandom
Syntax
(urandom size)
Arguments
- seed
- an
integer
External Function: weibull
Syntax
(weibull a b &optional (rng 0))
Arguments
- a
- a real in range a>0
- b
- a real in range b>0
Optional Arguments
- rng
- an
integer
(default 0)
Description
Returns a random variate from the Weibull distribution where a is the 'scale' parameter and b is the shape parameter. Sometimes Weibull is given with alpha and beta parameters, then alpha=b and beta=a. Uses random number stream rng in the current context.
The Weibull distribution gives the distribution of lifetimes of objects. It was originally proposed to quantify fatigue data, but it is also used in reliability analysis of systems involving a weakest link, e.g. in calculating a device's mean time to failure.
When b=1, (weibull a b) is exponential with mean a.
Generation uses inverse transform.
3.4 Ambiguous Symbols
3.4.3 Transmission-Channel
- Function:
transmission-channel
- Class:
transmission-channel
3.4.4 Gate-Direction
- Function:
gate-direction
- Type:
gate-direction
3.5 Index
3.5.1 Nonalphabetic
*context*
, Variable*simulation*
, Variable*simulation-init-hooks*
, Variable*simulation-trace-stream*
, Variable*time-format*
, Variable+c+
, Constant<=
, Function<=
, Function
3.5.2 A
arrival-time
, Functionarrived
, Functionaverage-queue-time
, Function
3.5.3 B
bernoulli
, Functionbeta
, Functionbinomial
, Functionbit-error-p
, Functionbit-length
, Functionbuffer-size
, Functionbuffer-size-bytes
, Functionbuild-connections
, Functionbuild-gates
, Functionbuild-inside
, Functionbuild-submodules
, Functionbusy-p
, Functionbyte-length
, Function
3.5.4 C
calculate-duration
, Functioncancel
, Functioncancel-timer
, Functioncauchy
, Functionchannel
, Functionchannel
, Classchannel-result
, Structurechi-square
, Functioncomponent
, Classcompound-module
, Classcompound-module-class
, Classconfiguration
, Functionconfigure
, Functionconnect
, Functionconnected-outside-p
, Functionconnected-p
, Functioncontrol-info
, Functioncoord
, Structurecoord*
, Functioncoord+
, Functioncoord-
, Functioncoord-op
, Functioncoord-x
, Functioncoord-y
, Functioncoord-z
, Functioncopy-slots
, Functioncpu-time-limit
, Functioncreation-time
, Functioncumulative-density-function
, Function
3.5.5 D
decapsulate
, Functiondefine-result-recorder
, Functiondefine-statistic-filter
, Macrodelay
, Functiondelay-channel
, Classdeliver
, Functiondeliver-on-reception-start-p
, Functiondequeue
, Functiondetailed-info
, Functiondisabled-p
, Functiondisconnect
, Functiondistance
, Functiondo-histogram
, Functionduplicate
, Functionduplicate-p
, Function
3.5.6 E
emit
, Functionempty-p
, Functionencapsulate
, Functionend-module
, Functionenqueue
, Functionentity-with-signals
, Classerlang-k
, Functionexponential
, Function
3.5.7 F
filter
, Macrofind-object
, Functionfinish
, Functionfor
, Macrofor-each-channel
, Functionfor-each-child
, Functionfor-each-gate
, Functionfor-each-submodule
, Functionformat-from-type
, Functionfrom-gate
, Functionfrom-module
, Functionfull-name
, Functionfull-path
, Function
3.5.8 G
gamma-d
, Functiongate
, Functiongate
, Classgate-direction
, Functiongate-direction
, Typegate-extend
, Functiongate-size
, Functiongate-slot
, Classgate-type
, Functiongeometric
, Function
3.5.9 H
handle-message
, Functionhandle-timer
, Functionhas-listeners
, Functionhistogram
, Classhistory-buffer
, Class
3.5.10 I
ideal-channel
, Classindex
, Functionindexed-count-recorder
, Classinfo
, Functioninitialize
, Functioninitialized-p
, Functioninput
, Functionintuniform
, Function
3.5.11 L
last-value
, Classlatency
, Functionlisteners
, Functionlognormal
, Function
3.5.12 M
make-coord
, Functionmay-have-listeners
, Functionmean
, Classmessage
, Functionmessage
, Classmessage-sent-signal-value
, Structuremessage-sent-signal-value message
, Functionmessage-sent-signal-value result
, Functionmessage-sent-signal-value timestamp
, Functionmodule
, Functionmodule
, Classmodule-class
, Classmt-random-state
, Class
3.5.13 N
name
, Functionnamed-object
, Classnegbinomial
, Functionnetwork
, Variablenetwork
, Functionnetwork
, Classnominal-datarate
, Functionnormal
, Function
3.5.14 O
output
, Functionowned-object
, Classowner
, Function
3.5.15 P
packet
, Classpacket-buffer
, Classparameter-class
, Classparameter-object
, Classparent-module
, Functionpareto-shifted
, Functionpath-end-gate
, Functionpath-start-gate
, Functionpeek
, Functionpoisson
, Functionprobability-density-function
, Functionprocess-message
, Functionproperty-union
, Function
3.5.16 Q
queue
, Function
3.5.17 R
rand
, Functionrange-getf
, Functionrange-list-p
, Functionread-configuration
, Functionread-parameter
, Functionreceive-signal
, Functionrecord
, Functionregister-signal
, Functionreinitialise-slots
, Functionrepair-signal-flags
, Functionreport
, Functionrng-map
, Functionroot-event
, Functionrun-simulations
, Function
3.5.18 S
schedule
, Functionschedule-at
, Functionscheduled-p
, Functionsec
, Functionseed
, Functionself-message-p
, Functionsend
, Functionsend-direct
, Functionsent-time
, Functionserialise
, Functionset-slots
, Functionset-timer
, Functionsignal-id
, Functionsim-time-limit
, Functionsimulation
, Classsimulation-condition
, Classsimulation-time
, Functionsize
, Functionstddev
, Classstop
, Functionstudent-t
, Functionsubmodule
, Functionsubscribe
, Functionsubscribed-p
, Functionsum
, Class
3.5.19 T
time-type
, Typetimeavg
, Classtimer
, Functiontimer-message
, Classtimestamp
, Functiontimestamped
, Structuretimestamped-queue
, Structuretimestamped-time
, Functiontimestamped-value
, Functiontitle
, Functionto-gate
, Functionto-module
, Functiontracelog
, Macrotransmission-channel
, Functiontransmission-channel
, Classtransmission-finish-time
, Functiontriang
, Functiontruncnormal
, Function
3.5.20 U
uniform
, Functionunknown-message
, Classunsubscribe
, Functionuntil
, Macrourandom
, Function
3.5.21 W
weibull
, Functionwhile
, Macrowith-timers
, Class
4 Colophon
This documentation was generated from Common Lisp source code using CLOD, version 1.0. The latest version of CLOD is available here.
5 Internal Package: lens.wsn
5.1 Description
A simulation package for Wireless Sensor Networks with interfaces and implementations for representing from physical processes, sensors, applications, communications (network, MAC and radio) and a wireless channel model including interference, asymetric bidirectional loss and temporal fading.
5.2 Class Hierarchy
5.3 External Symbols
5.3.1 External Classes
Class: app-net-control-info
Inheritance
- Parent classes: standard-object
- Precedence list: app-net-control-info, standard-object, slot-object, t
- Direct subclasses: None.
Description
Information passed between application and communication layer which is external to the packet i.e. not carried by a real packet (the source and destination addresses and quality measures of received signal for the packet)
Direct Slots
rssi
- Value type:
float
- Initial value:
NIL
- Initargs: rssi
- Allocation: instance
Received signal strength indicator (RSSI) of the received packet
rssi
(rssi object)
- (
rssi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
rssi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
rssi
(app-net-control-infolens.wsn:app-net-control-info
))
lqi
- Value type:
float
- Initial value:
NIL
- Initargs: lqi
- Allocation: instance
Link Quality Indicator (LQI) of the received packet
lqi
(lqi object)
- (
lqi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
lqi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
lqi
(app-net-control-infolens.wsn:app-net-control-info
))
source
- Value type:
t
- Initial value:
NIL
- Initargs: source
- Allocation: instance
Routing layer source address of the received packet
source
(source object)
- (
source
(wsn-packetlens.wsn:wsn-packet
)) - (
source
(app-net-control-infolens.wsn:app-net-control-info
))
destination
- Value type:
t
- Initial value:
NIL
- Initargs: destination
- Allocation: instance
Routing layer destination address of the packet to be sent
destination
(destination object)
- (
destination
(wsn-packetlens.wsn:wsn-packet
)) - (
destination
(app-net-control-infolens.wsn:app-net-control-info
))
Class: application
Inheritance
- Parent classes: wsn-module
- Precedence list: application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: throughput-test, connectivity-map, simple-aggregation, value-reporting, value propagation
Parameters
- applicationid
- a
symbol
. Used to filter packet delivery to specific applications. - priority
- a
integer
. Default:1
. What priority to give the application packets - header-overhead
- a
integer
. Default:8
. Size of application packet header in bytes - payload-overhead
- a
integer
. Default:12
. Size of application packet payload in bytes
Description
The Application core module class connects to node sensors for measurements and to the node communication module for sending and receiving data.
Direct Slots
owner
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
node
(node module)
- module
- a wsn-module
Return the parent node module for module/.
- (
node
(instancelens.wsn:comms-module
)) - (
node
(applicationlens.wsn:application
)) - (
node
(modulelens.wsn:wsn-module
))
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
- Parameter: t
- Properties: nil
Used to filter packet delivery to specific applications.
applicationid
(applicationid object)
- (
applicationid
(applicationlens.wsn:application
)) - (
applicationid
(application-packetlens.wsn:application-packet
))
priority
- Value type:
integer
- Initial value:
1
- Initargs: priority
- Allocation: instance
- Parameter: t
- Properties: nil
What priority to give the application packets
priority
(priority object)
- (
priority
(throughput-testlens.wsn:throughput-test
)) - (
priority
(connectivity-maplens.wsn:connectivity-map
)) - (
priority
(simple-aggregationlens.wsn:simple-aggregation
)) - (
priority
(applicationlens.wsn:application
))
header-overhead
- Value type:
integer
- Initial value:
8
- Initargs: header-overhead
- Allocation: instance
- Parameter: t
- Properties: nil
Size of application packet header in bytes
header-overhead
(header-overhead object)
- (
header-overhead
(comms-modulelens.wsn:comms-module
)) - (
header-overhead
(wsn-packetlens.wsn:wsn-packet
)) - (
header-overhead
(applicationlens.wsn:application
)) - (
header-overhead
(wireless-signal-endlens.wsn::wireless-signal-end
))
payload-overhead
- Value type:
integer
- Initial value:
12
- Initargs: payload-overhead
- Allocation: instance
- Parameter: t
- Properties: nil
Size of application packet payload in bytes
payload-overhead
(payload-overhead object)
- (
payload-overhead
(applicationlens.wsn:application
))
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
Sequence number of last packet sent
Indirect Slots
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: application-packet
Inheritance
- Parent classes: packet
- Precedence list: application-packet, packet, message, event, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: aggregate-application-packet
Description
A generic application packet. If defining your own packet you have to extend from this packet. You do not have to use the fields already defined, and you can always define your own size.
Direct Slots
name
- Value type:
t
- Initial value:
NIL
- Initargs: applicationid
- Allocation: instance
Used to filter packet delivery to specific applications.
applicationid
(applicationid object)
- (
applicationid
(applicationlens.wsn:application
)) - (
applicationid
(application-packetlens.wsn:application-packet
))
encapsulated-packet
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
payload
(payload object)
- (
payload
(application-packetlens.wsn:application-packet
))
sequence-number
- Value type:
t
- Initial value:
NIL
- Initargs: sequence-number, seqnum
- Allocation: instance
A field to distinguish between packets
sequence-number
(sequence-number object)
- (
sequence-number
(wsn-packetlens.wsn:wsn-packet
)) - (
sequence-number
(application-packetlens.wsn:application-packet
))
sequence-number
(sequence-number object)
- (
sequence-number
(wsn-packetlens.wsn:wsn-packet
)) - (
sequence-number
(application-packetlens.wsn:application-packet
))
byte-length
- Value type:
fixnum
- Initial value:
20
- Initargs: byte-length
- Allocation: instance
byte-length
(byte-length entity)
Return the length in whole octets (8 bit bytes) of
an entity
. For a packet the length should include the length
of all encapsulated packets together with its overhead.
- (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-gts-request packet))) - (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-ack-packet))) - (
byte-length
(pkt (eql lens.wsn.mac.802.15.4::mac802.15.4-associate packet))) - (
byte-length
(pktlens.wsn.mac.802.15.4::mac802.15.4-protocol-packet
)) - (
byte-length
(pktlens.wsn.mac.802.15.4::mac802.15.4-beacon-packet
)) - (
byte-length
(mac802.15.4-gts-request-packetlens.wsn.mac.802.15.4::mac802.15.4-gts request-packet
)) - (
byte-length
(mac802.15.4-ack-packetlens.wsn.mac.802.15.4::mac802.15.4-ack-packet
)) - (
byte-length
(mac802.15.4-associate-packetlens.wsn.mac.802.15.4::mac802.15.4-associate packet
)) - (
byte-length
(pktlens.wsn.routing.leach::aggregate-application-packet
)) - (
byte-length
(packetlens.wsn:wsn-packet
)) - (
byte-length
(application-packetlens.wsn:application-packet
)) - (
byte-length
(pktlens.wsn::wireless-signal-end
)) - (
byte-length
(packet-bufferpacket-buffer
)) - (
byte-length
(vbit-vector
))
Indirect Slots
bit-error-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
reception-start-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: deliver-on-reception-start
- Allocation: instance
control-info
- Value type:
t
- Initial value:
NIL
- Initargs: control-info
- Allocation: instance
duration
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
Class: bypass-mac
Inheritance
- Parent classes: mac
- Precedence list: bypass-mac, mac, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
None.
Description
Not documented.
Direct Slots
max-mac-frame-size
- Value type:
t
- Initial value:
0
- Initargs: none
- Allocation: instance
Indirect Slots
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: bypass-routing
Inheritance
- Parent classes: routing
- Precedence list: bypass-routing, routing, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
None.
Description
Not documented.
Direct Slots
max-net-frame-size
- Value type:
t
- Initial value:
0
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: comms-module
Inheritance
- Parent classes: wsn-module
- Precedence list: comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: radio, mac, routing
Parameters
- buffer-size
- a
integer
. Default:32
. Size of TX buffer - header-overhead
- a
integer
. Default:10
. The overhead added to encapsulated packets in bytes
Description
Base class for all WSN communications
submodules. This provides a header-overhead
parameter specifying
the default overhead for packets, a packet-buffer transmission
buffer for packets of maximum size specified by the buffer-size
parameter and a history-buffer for implementing the
duplicate-p to determine if we are receiving a duplicate packet.
Direct Slots
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
TX buffer
buffer
(buffer object)
- (
buffer
(comms-modulelens.wsn:comms-module
))
buffer-size
- Value type:
integer
- Initial value:
32
- Initargs: buffer-size
- Allocation: instance
- Parameter: t
- Properties: nil
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
received packet history buffer
packet-history
(packet-history object)
- (
packet-history
(comms-modulelens.wsn:comms module
))
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
last-sequence-number
(last-sequence-number object)
- (
last-sequence-number
(comms-modulelens.wsn:comms-module
))
header-overhead
- Value type:
integer
- Initial value:
10
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units b)
The overhead added to encapsulated packets in bytes
header-overhead
(header-overhead object)
- (
header-overhead
(comms-modulelens.wsn:comms-module
)) - (
header-overhead
(wsn-packetlens.wsn:wsn-packet
)) - (
header-overhead
(applicationlens.wsn:application
)) - (
header-overhead
(wireless-signal-endlens.wsn::wireless-signal-end
))
Indirect Slots
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: communications
Inheritance
- Parent classes: compound-module
- Precedence list: communications, compound module, module, component, parameter-object, entity-with signals, owned-object, named object, lens-object, standard object, slot-object, t
- Direct subclasses: None.
Parameters
None.
Description
The Communications module for a WSN node receives signals from the wireless-channel on the receive gate, passes them through the radio, mac and routing module representing the sublayers and sends application packets to the application (and visa versa).
Direct Slots
Indirect Slots
submodules
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: connectivity-map
Inheritance
- Parent classes: application
- Precedence list: connectivity-map, application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- priority
- a
t
. Default:1
. NIL - packet-spacing
- a
time-type
. Default:0.1d0
. NIL - packets-per-node
- a
integer
. Default:100
. NIL
Description
Application module that will generate packets-per-node packets at intervals of packets-per-spacing
- useful to determine connectivity statistics of a network.
Direct Slots
priority
- Value type:
t
- Initial value:
1
- Initargs: priority
- Allocation: instance
- Parameter: t
- Properties: nil
priority
(priority object)
- (
priority
(throughput-testlens.wsn:throughput-test
)) - (
priority
(connectivity-maplens.wsn:connectivity-map
)) - (
priority
(simple-aggregationlens.wsn:simple-aggregation
)) - (
priority
(applicationlens.wsn:application
))
packet-spacing
- Value type:
time-type
- Initial value:
0.1d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
packet-spacing
(packet-spacing object)
- (
packet-spacing
(throughput-testlens.wsn:throughput-test
)) - (
packet-spacing
(connectivity-maplens.wsn:connectivity-map
))
packets-per-node
- Value type:
integer
- Initial value:
100
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
packets-per-node
(packets-per-node object)
- (
packets-per-node
(connectivity-maplens.wsn:connectivity-map
))
packets-sent
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
packets-sent
(packets-sent object)
- (
packets-sent
(connectivity-maplens.wsn:connectivity-map
))
send-packet
- Value type:
timer-message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: direct-node-physical-process
Inheritance
- Parent classes: physical-process
- Precedence list: direct-node-physical-process, physical-process, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- default-value
- a
real
. Default:0.0
. NIL - assigned-values
- a
read
. Assigned values in a range specification
Description
Simple physical process where a value is assigned per node
Direct Slots
default-value
assigned-values
- Value type:
read
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Assigned values in a range specification
Indirect Slots
function
- Value type:
function
- Initial value: =#'(LAMBDA (LENS.WSN::M LENS.WSN::C LENS.WSN::TM) (DECLARE (IGNORE LENS.WSN::M LENS.WSN::C LENS.WSN::TM)) (UNIFORM 0.0 1.0))=
- Initargs: none
- Allocation: instance
description
- Value type:
string
- Initial value:
NIL
- Initargs: description
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: leach-routing
Inheritance
- Parent classes: routing
- Precedence list: leach-routing, routing, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- sink-network-address
- a
integer
. NIL - applicationid
- a
symbol
. Default: ='THROUGHPUT-TEST=. Default destination application for aggregates - percentage
- a
real
. NIL - round-length
- a
time-type
. NIL - slot-length
- a
real
. NIL - adv-packet-size
- a
fixnum
. Default:9
. NIL - join-packet-size
- a
fixnum
. Default:9
. NIL - tdma-packet-size
- a
fixnum
. Default:150
. NIL - data-packet-size
- a
fixnum
. Default:9
. NIL - sensibility
- a
float
. Default:-95
. dBm - aggr-consumption
- a
float
. Default:5.e-9
. Energy per bit used in transmitting aggregate data packet from cluster head
Description
Not documented.
Direct Slots
sink-network-address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
sink-network-address
(sink-network-address module)
- module
- an application or other wsn-module
Return the address of sink node for reporting applications. Default
is sink
however some applications take this as a parameter.
- (
sink-network-address
(simple-aggregationlens.wsn:simple-aggregation
)) - (
sink-network-address
(value-reportinglens.wsn:value-reporting
)) - (
sink-network-address
(leach-routinglens.wsn:leach-routing
)) - (
sink-network-address
(entitylens.wsn:application
)) - (
sink-network-address
(nodelens.wsn:node
)) - (
sink-network-address
(instancelens.wsn:wsn module
))
applicationid
- Value type:
symbol
- Initial value: ='LENS.WSN:THROUGHPUT-TEST=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
percentage
round-length
slot-length
adv-packet-size
join-packet-size
tdma-packet-size
data-packet-size
round-number
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
round-number
(round-number object)
- (
round-number
(leach-routinglens.wsn:leach-routing
))
probability
- Value type:
float
- Initial value:
0.0
- Initargs: none
- Allocation: instance
probability
(probability object)
- (
probability
(leach-routinglens.wsn:leach routing
))
sensibility
- Value type:
float
- Initial value:
-95
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
dBm
sensibility
(sensibility object)
- (
sensibility
(leach-routinglens.wsn:leach routing
))
aggr-consumption
- Value type:
float
- Initial value:
5.e-9
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Energy per bit used in transmitting aggregate data packet from cluster head
aggr-consumption
(aggr-consumption object)
- (
aggr-consumption
(leach-routinglens.wsn:leach-routing
))
aggregate-buffer
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Stacked up application packets for sending as aggregate
aggregate-buffer
(aggregate-buffer object)
- (
aggregate-buffer
(leach-routinglens.wsn:leach-routing
))
temp-tx-buffer
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Temp buffer for packets received before cluster formed
temp-tx-buffer
(temp-tx-buffer object)
- (
temp-tx-buffer
(leach-routinglens.wsn:leach-routing
))
cluster-members
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cluster-members
(cluster-members object)
- (
cluster-members
(leach-routinglens.wsn:leach-routing
))
cluster-head-candidates
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cluster-head-candidates
(cluster-head-candidates object)
- (
cluster-head-candidates
(leach-routinglens.wsn:leach-routing
))
powers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
powers
(powers object)
- (
powers
(leach-routinglens.wsn:leach-routing
))
cluster-head-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cluster-head-p
(cluster-head-p object)
- (
cluster-head-p
(leach-routinglens.wsn:leach-routing
))
end-form-cluster
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
end-form-cluster
(end-form-cluster object)
- (
end-form-cluster
(leach-routinglens.wsn:leach-routing
))
ct-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: line-mobility
Inheritance
- Parent classes: mobility
- Precedence list: line-mobility, mobility, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- destination
- a
coord
. Default:(MAKE-COORD 1.0 1.0)
. End location coordinate. - speed
- a
real
. Default:1
. Speed of motion - update-interval
- a
time-type
. Default:1.0d0
. Time tnterval for position updates along trajectory
Description
mobility module for movement backwards and forwards along a straight line between start-location and destination-location.
Direct Slots
start-location
- Value type:
coord
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Starting location coordinate
start-location
(start-location object)
- (
start-location
(line-mobilitylens.wsn:line-mobility
))
destination
- Value type:
coord
- Initial value:
(MAKE-COORD 1.0 1.0)
- Initargs: destination-location
- Allocation: instance
- Parameter: t
- Properties: nil
delta
- Value type:
coord
- Initial value:
NIL
- Initargs: none
- Allocation: instance
distance
- Value type:
real
- Initial value:
NIL
- Initargs: none
- Allocation: instance
speed
- Value type:
real
- Initial value:
1
- Initargs: speed
- Allocation: instance
- Parameter: t
- Properties: nil
update-interval
- Value type:
time-type
- Initial value:
1.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Time tnterval for position updates along trajectory
update-interval
(update-interval object)
- (
update-interval
(resourceslens.wsn:resources
)) - (
update-interval
(line-mobilitylens.wsn:line-mobility
))
update
- Value type:
timer-message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
static-p
- Value type:
t
- Initial value:
T
- Initargs: static-p
- Allocation: instance
orientation
- Value type:
orientation
- Initial value:
(LENS.WSN::MAKE-ORIENTATION)
- Initargs: orientation
- Allocation: instance
Initial orientation for node
location
- Value type:
coord
- Initial value:
NIL
- Initargs: location
- Allocation: instance
Initial location coord for node.
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mac
Inheritance
- Parent classes: comms-module
- Precedence list: mac, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: mac802.15.4, tmac, tuneable-mac, bypass-mac
Parameters
- max-mac-frame-size
- a
integer
. Default:0
. in bytes - address
- a
integer
. MAC address - will default to nodeid.
Description
Base class for all mac layer module implementations. Connects to radio submodule and routing submodule in the communications module. Has a mac-address physical layer adress for this device (defaults to the nodeid and a max-mac-frame-size specifyin largest packet size accepted.
Direct Slots
max-mac-frame-size
- Value type:
integer
- Initial value:
0
- Initargs: max-mac-frame-size
- Allocation: instance
- Parameter: t
- Properties: (units b)
in bytes
max-mac-frame-size
(max-mac-frame-size object)
- (
max-mac-frame-size
(maclens.wsn:mac
))
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
MAC address - will default to nodeid.
mac-address
(mac-address object)
- (
mac-address
(radiolens.wsn:radio
)) - (
mac-address
(nodelens.wsn:node
)) - (
mac-address
(maclens.wsn:mac
))
radio
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Indirect Slots
header-overhead
- Value type:
integer
- Initial value:
10
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer-size
- Value type:
integer
- Initial value:
32
- Initargs: buffer-size
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mac-control-command
Inheritance
- Parent classes: communications-control-command
- Precedence list: mac-control-command, communications-control-command, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mac-control-message
Inheritance
- Parent classes: communications-control-message
- Precedence list: mac-control-message, communications-control-message, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mac-packet
Inheritance
- Parent classes: wsn-packet
- Precedence list: mac-packet, wsn-packet, packet, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: mac802.15.4-packet, tmac packet
Description
Base class for all mac-layer packet types.
Direct Slots
Indirect Slots
sequence-number
- Value type:
t
- Initial value:
NIL
- Initargs: sequence-number, seqnum
- Allocation: instance
destination
- Value type:
t
- Initial value:
NIL
- Initargs: destination
- Allocation: instance
source
- Value type:
t
- Initial value:
NIL
- Initargs: source
- Allocation: instance
header-overhead
- Value type:
t
- Initial value:
0
- Initargs: byte-length, header-overhead
- Allocation: instance
bit-error-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
reception-start-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: deliver-on-reception-start
- Allocation: instance
control-info
- Value type:
t
- Initial value:
NIL
- Initargs: control-info
- Allocation: instance
duration
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
encapsulated-packet
- Value type:
packet
- Initial value:
NIL
- Initargs: encapsulated-packet
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mac-radio-control-info
Inheritance
- Parent classes: standard-object
- Precedence list: mac-radio-control-info, standard-object, slot-object, t
- Direct subclasses: None.
Description
Control information from radi to mac layers (RSSI or LQI)
Direct Slots
rssi
- Value type:
double-float
- Initial value:
NIL
- Initargs: rssi
- Allocation: instance
the RSSI of the received packet
rssi
(rssi object)
- (
rssi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
rssi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
rssi
(app-net-control-infolens.wsn:app-net-control-info
))
lqi
- Value type:
double-float
- Initial value:
NIL
- Initargs: lqi
- Allocation: instance
the LQI of the received packet
lqi
(lqi object)
- (
lqi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
lqi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
lqi
(app-net-control-infolens.wsn:app-net-control-info
))
Class: mac802.15.4
Inheritance
- Parent classes: mac
- Precedence list: mac802.15.4, mac, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- print-state-transitions
- a
boolean
. Debugging parameter - max-mac-frame-size
- a
t
. Default:0
. NIL - header-overhead
- a
t
. Default:14
. NIL - buffer-size
- a
t
. Default:32
. NIL - enable-slotted-csma
- a
boolean
. Default:T
. Enables the slotted version of the CSMA algorithm, explained in the standard. - enable-cap
- a
boolean
. Default:T
. NIL - is-ffd
- a
boolean
. Is the node a full function device? These are the only devices which can act as coordinators. - is-pan-coordinator
- a
boolean
. Is the node the PAN coordinator? - battery-life-extension
- a
boolean
. NIL - frame-order
- a
fixnum
. Default:4
. Specifies how long is the active portion of a frame, when radios are listening or transmitting. Specifically it is equal to base-superframe-duration^{2 frame-order}. - beacon-order
- a
fixnum
. Default:6
. Specifies how long is the full frame (active and inactive). This is the period between two beacons. Specifically it is equal to base-superframe-duration^{2 beacon-order}. - unit-backoff-period
- a
fixnum
. Default:20
. Specifies how long is the unit of time used in backing off in symbols. More specifically the standard uses a exponential backoff technique and the backoff time is: random(1…2backoff-exponent-1) · (unit-backoff-period · symbol-time). Backoff_exponent is a variable automatically updated by the protocol. - base-slot-duration
- a
fixnum
. Default:60
. Parameter used to calculate base-superframe-duration - num-superframe-slots
- a
fixnum
. Default:16
. Parameter used to calculate base-superframe-duration - min-be
- a
fixnum
. Default:5
. In calculating the backoff time, this is the minimum value that the backoff exponent can take. - max-be
- a
fixnum
. Default:7
. In calculating the backoff time, this is the maximum value that the backoff exponent can take. - max-csma-backoffs
- a
fixnum
. Default:4
. Maximum number of backoffs until the transmission of the packet is aborted and go for another retry (if there are any left). - max-frame-retries
- a
fixnum
. Default:2
. Maximum number of retries until the packet is considered lost and the upper layer notified. - max-lost-beacons
- a
fixnum
. Default:4
. Maximum number of beacons lost until the node considers itself disassociated from the PAN coordinator. - min-cap-length
- a
fixnum
. Default:440
. The minimum length of CAP period when GTS is used, defined in symbols. - request-gts
- a
fixnum
. Default:0
. Allows a node to request a specified number of GTS slots from the coordinator. If the request is successful, DATA packets will be transmitted in the GTS slots assigned by the coordinator These slots are assigned dynamically according to availability. If no slots are available, the request will fail. Note that this is an easy way for a node to statically request a certain number of slots. A more dynamic solution would be for the application module to instruct the MAC module how many slots should it request. The current (parameter-based) solution is a shortcut when we have constant application traffic and we can figure out a priory an optimal way to share the slots among the nodes. - guard-time
- a
time-type
. Default:0.001
. Reception guard time to sue in physical layer. Essential when dealing with time synchronisation.
Description
IEEE802.15.4 MAC - IEE standard for wireless low-power short range communications.
Functionality implemented:
- CSMA-CA functionality (slotted and unslotted)
- Beacon-enabled PANs with association (auto associate)
- Direct data transfer mode
- Guaranteed time slots (GTS).
Features that are NOT implemented:
- Non-beacon PANs
- Indirect data transfer mode
- Multihop PAN topologies
See The IEEE 802.15.4 standard (ver. 2006) [http://standards.ieee.org/getieee802/download/802.15.4-2006.pdf]
Direct Slots
print-state-transitions
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
max-mac-frame-size
header-overhead
buffer-size
enable-slotted-csma
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
enable-cap
is-ffd
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
is-pan-coordinator
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
battery-life-extension
frame-order
- Value type:
fixnum
- Initial value:
4
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
beacon-order
- Value type:
fixnum
- Initial value:
6
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
unit-backoff-period
- Value type:
fixnum
- Initial value:
20
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Specifies how long is the unit of time used in backing off in symbols. More specifically the standard uses a exponential backoff technique and the backoff time is: random(1…2backoff-exponent-1) · (unit-backoff-period · symbol-time). Backoff_exponent is a variable automatically updated by the protocol.
base-slot-duration
- Value type:
fixnum
- Initial value:
60
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Parameter used to calculate base-superframe-duration
num-superframe-slots
- Value type:
fixnum
- Initial value:
16
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Parameter used to calculate base-superframe-duration
base-superframe-duration
min-be
- Value type:
fixnum
- Initial value:
5
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
max-be
- Value type:
fixnum
- Initial value:
7
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
max-csma-backoffs
- Value type:
fixnum
- Initial value:
4
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
max-frame-retries
- Value type:
fixnum
- Initial value:
2
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
max-lost-beacons
- Value type:
fixnum
- Initial value:
4
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
min-cap-length
- Value type:
fixnum
- Initial value:
440
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
request-gts
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Allows a node to request a specified number of GTS slots from the coordinator. If the request is successful, DATA packets will be transmitted in the GTS slots assigned by the coordinator These slots are assigned dynamically according to availability. If no slots are available, the request will fail. Note that this is an easy way for a node to statically request a certain number of slots. A more dynamic solution would be for the application module to instruct the MAC module how many slots should it request. The current (parameter-based) solution is a shortcut when we have constant application traffic and we can figure out a priory an optimal way to share the slots among the nodes.
guard-time
- Value type:
time-type
- Initial value:
0.001
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
associated-pan
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
state
- Value type:
mac802.15.4-state
- Initial value: ='LENS.WSN.MAC.802.15.4::SETUP=
- Initargs: none
- Allocation: instance
state
(state instance)
- instance
- an object with state handling.
Return current state identifier of instance
- (
state
(mac802.15.4lens.wsn:mac802.15.4
)) - (
state
(tmaclens.wsn:tmac
)) - (
state
(tuneable-maclens.wsn:tuneable-mac
)) - (
state
(radiolens.wsn:radio
))
next-state
- Value type:
mac802.15.4-state
- Initial value:
NIL
- Initargs: none
- Allocation: instance
cap-length
- Value type:
fixnum
- Initial value:
NIL
- Initargs: none
- Allocation: instance
mac-bsn
- Value type:
integer
- Initial value:
(RANDOM 255)
- Initargs: none
- Allocation: instance
next-packet-retries
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
lost-beacons
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
frame-interval
- Value type:
fixnum
- Initial value:
NIL
- Initargs: none
- Allocation: instance
beacon-interval
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
csma-number-backoffs
csma-contention-window-length
csma-backoff-exponent
cap-end
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
current-frame-start
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
next-packet-response
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
associated-devices
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
beacon-packet
associate-request-packet
next-packet
gts-spec
- Value type:
vector
- Initial value:
(MAKE-ARRAY 0 :ADJUSTABLE T)
- Initargs: none
- Allocation: instance
attempt-tx
- Value type:
t
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: mobility
Inheritance
- Parent classes: wsn-module
- Precedence list: mobility, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: no-mobility, line-mobility
Parameters
- location
- a
coord
. Initial location coord for node. - orientation
- a
lens.wsn::orientation
. Default:(MAKE-ORIENTATION)
. Initial orientation for node
Description
Superclass for mobility submodules of a node handling node mobility. Base class of this initialises the location from the deployment pand field arameters of the network to initialise all node positions for static nodes. Deployment takes the current forms.
Network Parameters
- field
- a list of the x, y and optionally z sizes of the network in m
- deployment
- a symbol deployment-type for the whole network or a range-list mapping node ids to the deployment-type to nodes.
Deployment Types
Specify how nodes are located over the network field.
- uniform
- random uniform deployment over entire field.
- center
- located in the center of the field
- (grid dx dy dz)
- nodes are located on a grid with cell dimensions (dz dy dz)
- (randomized dx dy dz)
- nodes are randomly located withing the cells of dimensions (dx dy dz)
Direct Slots
location
- Value type:
coord
- Initial value:
NIL
- Initargs: location
- Allocation: instance
- Parameter: t
- Properties: nil
Initial location coord for node.
location
(location object)
- (
location
(nodelens.wsn:node
)) - (
location
(mobilitylens.wsn:mobility
))
orientation
- Value type:
orientation
- Initial value:
(LENS.WSN::MAKE-ORIENTATION)
- Initargs: orientation
- Allocation: instance
- Parameter: t
- Properties: nil
Initial orientation for node
orientation
(orientation object)
- (
orientation
(mobilitylens.wsn:mobility
))
static-p
- Value type:
t
- Initial value:
T
- Initargs: static-p
- Allocation: instance
If true (default) this the node is static. Subclasses should specialise this appropriately.
Indirect Slots
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: multipath-rings-routing
Inheritance
- Parent classes: routing
- Precedence list: multipath-rings-routing, routing, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- setup-overhead
- a
integer
. Default:13
. The size of a specific control message to setup the rings - setup-frame-size
- a
fixnum
. Default:13
. NIL - setup-timeout
- a
time-type
. Default:0.05d0
. Specifies a timeout when the setting up of the network tree (or level information) is taking place. If a particular node does not receive timely information it might declare it self "not connected" and reports this to the application with a message.
Description
Multipath Rings Routing nodes do not have a specific parent. A node just gets a level number (or ring number) during setup. The first setup packet sent from the sink has level
- Any node that receives it adds 1 to the level and retransmits
it. The process continues with every node adding 1 to the level of the received packet. Eventually all connected nodes will have a level number (there is also a possibility for unconnected nodes). When a node wants to send a packet to the sink it does not send it to a particular node but rather broadcasts it, attaching its level number. Any node with a smaller level number will rebroadcast it. The process continues until the sink is reached. You can see with this algorithm many paths to the sink can be taken. The algorithm can be more robust compared to single route algorithms but if the traffic is passes a certain low threshold, congestion can kill performance.
Direct Slots
setup-overhead
- Value type:
integer
- Initial value:
13
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
The size of a specific control message to setup the rings
setup-overhead
(setup-overhead object)
- (
setup-overhead
(multipath-rings-routinglens.wsn:multipath-rings-routing
))
setup-frame-size
- Value type:
fixnum
- Initial value:
13
- Initargs: setup-frame-size
- Allocation: instance
- Parameter: t
- Properties: nil
setup-frame-size
(setup-frame-size object)
- (
setup-frame-size
(multipath-rings-routinglens.wsn:multipath-rings-routing
))
setup-timeout
- Value type:
time-type
- Initial value:
0.05d0
- Initargs: setup-timeout
- Allocation: instance
- Parameter: t
- Properties: nil
Specifies a timeout when the setting up of the network tree (or level information) is taking place. If a particular node does not receive timely information it might declare it self "not connected" and reports this to the application with a message.
setup-timeout
(setup-timeout object)
- (
setup-timeout
(multipath-rings-routinglens.wsn:multipath-rings-routing
))
current-sink
- Value type:
mprings-sink
- Initial value:
NIL
- Initargs: none
- Allocation: instance
current-sink
(current-sink object)
- (
current-sink
(multipath-rings-routinglens.wsn:multipath-rings-routing
))
connected-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
connected-p
(connected-p instance)
- (
connected-p
(multipath-rings-routinglens.wsn:multipath-rings-routing
)) - (
connected-p
(gategate
))
tmp-sink
- Value type:
mprings-sink
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Used during setup
Indirect Slots
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: net-mac-control-info
Inheritance
- Parent classes: standard-object
- Precedence list: net-mac-control-info, standard-object, slot-object, t
- Direct subclasses: None.
Description
Information between routing and MAC which is external to but related to the packet i.e. not carried by a real packet (e.g., what is the next hop, or what was the RSSI for the packet received).
Direct Slots
rssi
- Value type:
double-float
- Initial value:
NIL
- Initargs: rssi
- Allocation: instance
the RSSI of the received packet
rssi
(rssi object)
- (
rssi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
rssi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
rssi
(app-net-control-infolens.wsn:app-net-control-info
))
lqi
- Value type:
double-float
- Initial value:
NIL
- Initargs: lqi
- Allocation: instance
the LQI of the received packet
lqi
(lqi object)
- (
lqi
(mac-radio-control-infolens.wsn:mac-radio-control-info
)) - (
lqi
(net-mac-control-infolens.wsn:net-mac-control-info
)) - (
lqi
(app-net-control-infolens.wsn:app-net-control-info
))
next-hop
- Value type:
integer
- Initial value:
NIL
- Initargs: next-hop
- Allocation: instance
next-hop
(next-hop object)
- (
next-hop
(net-mac-control-infolens.wsn:net-mac-control-info
))
last-hop
- Value type:
integer
- Initial value:
NIL
- Initargs: last-hop
- Allocation: instance
last-hop
(last-hop object)
- (
last-hop
(net-mac-control-infolens.wsn:net-mac-control-info
))
External Class: network
Inheritance
- Parent classes: compound-module
- Precedence list: network, compound-module, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: wsn
Parameters
None.
Description
Base class for networks. This is the required type
for the top-level compound-module of a simulation network and it
is required that it has no gate specification. It is specified in
the network
simulation parameter.
Direct Slots
gate-slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Indirect Slots
submodules
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
External Class: network
Inheritance
- Parent classes: compound-module
- Precedence list: network, compound-module, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: wsn
Parameters
None.
Description
Base class for networks. This is the required type
for the top-level compound-module of a simulation network and it
is required that it has no gate specification. It is specified in
the network
simulation parameter.
Direct Slots
gate-slots
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Indirect Slots
submodules
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: network-control-command
Inheritance
- Parent classes: communications-control-command
- Precedence list: network-control-command, communications-control-command, message, event, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: network-control-message
Inheritance
- Parent classes: communications-control-message
- Precedence list: network-control-message, communications-control-message, message, event, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: multipath-rings-routing control-message
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: no-mobility
Inheritance
- Parent classes: mobility
- Precedence list: no-mobility, mobility, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
None.
Description
Alias for [[mobility] ] module for no movement for consistency in naming
Direct Slots
Indirect Slots
static-p
- Value type:
t
- Initial value:
T
- Initargs: static-p
- Allocation: instance
orientation
- Value type:
orientation
- Initial value:
(LENS.WSN::MAKE-ORIENTATION)
- Initargs: orientation
- Allocation: instance
Initial orientation for node
location
- Value type:
coord
- Initial value:
NIL
- Initargs: location
- Allocation: instance
Initial location coord for node.
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: node
Inheritance
- Parent classes: compound-module
- Precedence list: node, compound-module, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- network-address
- a
t
. The network address for this node. Defaults to nodeid - startup-offset
- a
time-type
. Default:0.0d0
. Node offset startup delay in seconds - startup-randomization
- a
time-type
. Default:0.05d0
. Node startup delay randomisation, in seconds
Description
Base class representing sensing motes on a wireless sensor motes. Brings together an array of sensors which received measurements from the physical-processs being sensed, a sensing application on the mote, the communications module receibing messages from the global wireless-channell and implementing the communications protocols, mobility handling mote movement, and a resources module handling energy usages.
Direct Slots
owner
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Nodes are owned by the wsn network
network
(network object)
- (
network
(nodelens.wsn:node
)) - (
network
(instancet
)) - (
network
(simulationsimulation
))
index
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Nodeid is an integer - the index of the node in the network array of nodes.
network-address
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
The network address for this node. Defaults to nodeid
network-address
(network-address object)
- (
network-address
(instancelens.wsn:routing
)) - (
network-address
(nodelens.wsn:node
))
startup-offset
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Node offset startup delay in seconds
startup-offset
(startup-offset object)
- (
startup-offset
(nodelens.wsn:node
))
startup-randomization
- Value type:
time-type
- Initial value:
0.05d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Node startup delay randomisation, in seconds
startup-randomization
(startup-randomization object)
- (
startup-randomization
(nodelens.wsn:node
))
Indirect Slots
submodules
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Class: physical-process
Inheritance
- Parent classes: module
- Precedence list: physical-process, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: direct-node-physical-process, scenario-physical-process
Parameters
- description
- a
string
. Text description of a physical process - function
- a
(eval :type function)
. Default: =#'(LAMBDA (M C TM) (DECLARE (IGNORE M C TM)) (UNIFORM 0.0 1.0))=. A function measurand, location and time returning measured value. Default is uniform ransom number betwee 0 and 1.
Description
Base class for modules representing physical processes to be measured by a wireless snesor network. Subclasses should specialise measure.
Direct Slots
description
- Value type:
string
- Initial value:
NIL
- Initargs: description
- Allocation: instance
- Parameter: t
- Properties: nil
Text description of a physical process
description
(description object)
- (
description
(physical-processlens.wsn:physical-process
))
function
- Value type:
function
- Initial value: =#'(LAMBDA (LENS.WSN::M LENS.WSN::C LENS.WSN::TM) (DECLARE (IGNORE LENS.WSN::M LENS.WSN::C LENS.WSN::TM)) (UNIFORM 0.0 1.0))=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (format (eval type function))
A function measurand, location and time returning measured value. Default is uniform ransom number betwee 0 and 1.
physical-process-function
(physical-process-function object)
- (
physical-process-function
(physical-processlens.wsn:physical-process
))
Indirect Slots
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: radio
Inheritance
- Parent classes: comms-module
- Precedence list: radio, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- address
- a
integer
. MAC address - will default to node index. - parameters-file
- a
pathname
. the file that contains most radio parameters - initial-mode
- a
symbol
. we can choose an rx-mode to begin with. Modes are defined in the RadioParametersFile. nil means use the first mode defined) - state
- a
symbol
. Default: ='RX=. we can choose a radio state to begin with. RX and TX are always there. according to the radio defined we can choose from a different set of sleep states - initial-tx-output-power
- a
float
. we can choose a Txpower to begin with. Possible tx power values are defined in the RadioParametersFile. nil means use the first tx power defined (which is also the highest) - initial-sleep-level
- a
symbol
. we can choose a sleep level which will be used when a transition to SLEEP state is requested. nil means use first level defined (will usually be the fastest and most energy consuming sleep state) - carrier-frequency
- a
float
. Default:2.4e9
. the carrier frequency (in Hz) to begin with. - collision-model
- a
symbol
. Default: ='ADDITIVE-INTERFERENCE-MODEL=. none, simple, additive or advance interference - cca-threshold
- a
float
. Default:-95
. the threshold of the RSSI register (in dBm) were above it channel is NOT clear - symbols-for-rssi
- a
integer
. Default:8
. NIL - carrier-sense-interrupt-enabled
- a
boolean
. NIL - max-phy-frame-size
- a
fixnum
. Default:1024
. in bytes - avg-busy-frame
- a
time-type
. Default:1.0d0
. integration time for measuring avg busy time - processing-delay
- a
time-type
. Default:1.d-5
. delay to pass packets/messages/interrupts to upper layer
Description
Radio implementation for WSN networks. The radio characteristics are read from a configuration file specified in the parameters-file parameter. This implements radio interference models by using wireless-signal-start and wireless-signal-end messages from wireless channel to determine if received signal can be passsed up to mac layer. MAC layer packets received for transmission are buffered. radio-command-message messages received from MAC can be used to switch between radio states etc.
Direct Slots
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
MAC address - will default to node index.
mac-address
(mac-address object)
- (
mac-address
(radiolens.wsn:radio
)) - (
mac-address
(nodelens.wsn:node
)) - (
mac-address
(maclens.wsn:mac
))
parameters-file
- Value type:
pathname
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
the file that contains most radio parameters
parameters-file
(parameters-file object)
- (
parameters-file
(radiolens.wsn:radio
))
initial-mode
- Value type:
symbol
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
state
- Value type:
symbol
- Initial value: ='LENS.WSN:RX=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
we can choose a radio state to begin with. RX and TX are always there. according to the radio defined we can choose from a different set of sleep states
state
(state instance)
- instance
- an object with state handling.
Return current state identifier of instance
- (
state
(mac802.15.4lens.wsn:mac802.15.4
)) - (
state
(tmaclens.wsn:tmac
)) - (
state
(tuneable-maclens.wsn:tuneable-mac
)) - (
state
(radiolens.wsn:radio
))
initial-tx-output-power
- Value type:
float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
initial-sleep-level
- Value type:
symbol
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
carrier-frequency
- Value type:
float
- Initial value:
2.4e9
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units hz)
the carrier frequency (in Hz) to begin with.
carrier-frequency
(carrier-frequency object)
- (
carrier-frequency
(radiolens.wsn:radio
)) - (
carrier-frequency
(wireless-signal-startlens.wsn::wireless-signal-start
))
encoding
- Value type:
t
- Initial value: ='LENS.WSN::NRZ=
- Initargs: none
- Allocation: instance
encoding
(encoding object)
- (
encoding
(radiolens.wsn:radio
)) - (
encoding
(wireless-signal-startlens.wsn::wireless-signal-start
))
collision-model
- Value type:
symbol
- Initial value: ='LENS.WSN:ADDITIVE-INTERFERENCE-MODEL=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
none, simple, additive or advance interference
collision-model
(collision-model object)
- (
collision-model
(radiolens.wsn:radio
))
cca-threshold
- Value type:
float
- Initial value:
-95
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
the threshold of the RSSI register (in dBm) were above it channel is NOT clear
cca-threshold
(cca-threshold object)
- (
cca-threshold
(radiolens.wsn:radio
))
symbols-for-rssi
- Value type:
integer
- Initial value:
8
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
symbols-for-rssi
(symbols-for-rssi object)
- (
symbols-for-rssi
(radiolens.wsn:radio
))
carrier-sense-interrupt-enabled
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
carrier-sense-interrupt-enabled
(carrier-sense-interrupt-enabled object)
- (
carrier-sense-interrupt-enabled
(radiolens.wsn:radio
))
max-phy-frame-size
- Value type:
fixnum
- Initial value:
1024
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units b)
in bytes
max-phy-frame-size
(max-phy-frame-size object)
- (
max-phy-frame-size
(radiolens.wsn:radio
))
header-overhead
- Value type:
t
- Initial value:
6
- Initargs: none
- Allocation: instance
avg-busy-frame
- Value type:
time-type
- Initial value:
1.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units s)
integration time for measuring avg busy time
avg-busy-frame
(avg-busy-frame object)
- (
avg-busy-frame
(radiolens.wsn:radio
))
avg-busy
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
wireless-channel
- Value type:
gate
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Gate to directly send wireless messages to. Messages from the wireless layer will be send direct to fromWireless input gate in radio module
wireless-channel
(wireless-channel object)
- (
wireless-channel
(radiolens.wsn:radio
))
tx-levels
- Value type:
sequence
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rx-modes
- Value type:
sequence
- Initial value:
NIL
- Initargs: none
- Allocation: instance
sleep-levels
- Value type:
sequence
- Initial value:
NIL
- Initargs: none
- Allocation: instance
sleep-levels
(sleep-levels object)
- (
sleep-levels
(radiolens.wsn:radio
))
transitions
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Power and delay for transitions between states stored in p-list of p-lists - access is (getf (getf args to) from)
tx-level
- Value type:
tx-level
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rx-mode
- Value type:
rx-mode
- Initial value:
NIL
- Initargs: none
- Allocation: instance
sleep-level
- Value type:
sleep-level
- Initial value:
NIL
- Initargs: none
- Allocation: instance
last-transition-time
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
last-transition-time
(last-transition-time object)
- (
last-transition-time
(radiolens.wsn:radio
))
changing-to-state
- Value type:
radio-state
- Initial value:
NIL
- Initargs: none
- Allocation: instance
indicates that the Radio is in the middle of changing to a new state
changing-to-state
(changing-to-state object)
- (
changing-to-state
(radiolens.wsn:radio
))
received-signals
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
a list of signals curently being received
received-signals
(received-signals object)
- (
received-signals
(radiolens.wsn:radio
))
time-of-last-signal-change
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
last time the above list changed
time-of-last-signal-change
(time-of-last-signal-change object)
- (
time-of-last-signal-change
(radiolens.wsn:radio
))
total-power-received
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
a history of recent changes in total received power to help calculate RSSI
total-power-received
(total-power-received object)
- (
total-power-received
(radiolens.wsn:radio
))
rssi-integration-time
- Value type:
time-type
- Initial value:
1.0d0
- Initargs: none
- Allocation: instance
span of time the total received power is integrated to calculate RSSI
rssi-integration-time
(rssi-integration-time object)
- (
rssi-integration-time
(radiolens.wsn:radio
))
cs-interrupt-message
- Value type:
radio-control-message
- Initial value:
(MAKE-INSTANCE 'LENS.WSN:RADIO-CONTROL-MESSAGE :COMMAND 'LENS.WSN:CARRIER-SENSE-INTERRUPT)
- Initargs: none
- Allocation: instance
message that carries a future carrier sense interrupt
cs-interrupt-message
(cs-interrupt-message object)
- (
cs-interrupt-message
(radiolens.wsn:radio
))
state-transition-message
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'MESSAGE :NAME 'LENS.WSN::STATE-TRANSITION)
- Initargs: none
- Allocation: instance
Self message to complete state transmisition
state-transition-message
(state-transition-message object)
- (
state-transition-message
(radiolens.wsn:radio
))
continue-tx-message
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'MESSAGE :NAME 'LENS.WSN::RADIO-CONTINUE-TX)
- Initargs: none
- Allocation: instance
Self message to continue transmitting
continue-tx-message
(continue-tx-message object)
- (
continue-tx-message
(radiolens.wsn:radio
))
state-after-tx
- Value type:
radio-state
- Initial value: ='LENS.WSN:RX=
- Initargs: none
- Allocation: instance
state-after-tx
(state-after-tx object)
- (
state-after-tx
(radiolens.wsn:radio
))
processing-delay
- Value type:
time-type
- Initial value:
1.d-5
- Initargs: processing-delay
- Allocation: instance
- Parameter: t
- Properties: nil
delay to pass packets/messages/interrupts to upper layer
processing-delay
(processing-delay object)
- (
processing-delay
(radiolens.wsn:radio
))
Indirect Slots
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: radio-control-command
Inheritance
- Parent classes: communications-control-command
- Precedence list: radio-control-command, communications-control-command, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: radio-control-message
Inheritance
- Parent classes: communications-control-message
- Precedence list: radio-control-message, communications-control-message, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Description
Not documented.
Direct Slots
Indirect Slots
argument
- Value type:
t
- Initial value:
NIL
- Initargs: argument
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: resources
Inheritance
- Parent classes: wsn-module
- Precedence list: resources, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- ram-size
- a
integer
. Default:0
. in kB - flash-size
- a
integer
. Default:0
. in kB - flash-write-cost
- a
integer
. Default:0
. in kB - ram-read-cost
- a
integer
. Default:0
. in kB - cpu-power-levels
- a
list
. plist mapping power level names to power - cpu-power-level
- a
symbol
. Current power level - initialised from parameter - clock-drift-sigma
- a
time-type
. Default:3.d-5
. Standard deviation in cpu clock drift - remaining-energy
- a
double-float
. Default:18720.0d0
. In joules - default is 2 AA batteries - baseline-node-power
- a
real
. Default:0.006
. Periodic power consumption - update-interval
- a
time-type
. Default:1.0d0
. Interval for periodic updates in energy
Description
Not documented.
Direct Slots
ram-size
- Value type:
integer
- Initial value:
0
- Initargs: ram-size
- Allocation: instance
- Parameter: t
- Properties: nil
flash-size
- Value type:
integer
- Initial value:
0
- Initargs: flash-size
- Allocation: instance
- Parameter: t
- Properties: nil
total-ram-data
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
total-ram-data
(total-ram-data object)
- (
total-ram-data
(resourceslens.wsn:resources
))
flash-write-cost
- Value type:
integer
- Initial value:
0
- Initargs: flash-write-cost
- Allocation: instance
- Parameter: t
- Properties: nil
ram-read-cost
- Value type:
integer
- Initial value:
0
- Initargs: ram-read-cost
- Allocation: instance
- Parameter: t
- Properties: nil
cpu-power-levels
- Value type:
list
- Initial value:
NIL
- Initargs: cpu-power-levels
- Allocation: instance
- Parameter: t
- Properties: nil
cpu-power-level
- Value type:
symbol
- Initial value:
NIL
- Initargs: cpu-power-level
- Allocation: instance
- Parameter: t
- Properties: nil
clock-drift-sigma
- Value type:
time-type
- Initial value:
3.d-5
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
remaining-energy
- Value type:
double-float
- Initial value:
18720.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
In joules - default is 2 AA batteries
remaining-energy
(remaining-energy object)
- (
remaining-energy
(resourceslens.wsn:resources
))
time-of-last-calculation
baseline-node-power
- Value type:
real
- Initial value:
0.006
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
current-node-power
- Value type:
float
- Initial value:
0.0
- Initargs: none
- Allocation: instance
current-node-power
(current-node-power object)
- (
current-node-power
(resourceslens.wsn:resources
))
power-levels
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Last power drawn indexed by module
power-levels
(power-levels object)
- (
power-levels
(resourceslens.wsn:resources
))
update-interval
- Value type:
time-type
- Initial value:
1.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Interval for periodic updates in energy
update-interval
(update-interval object)
- (
update-interval
(resourceslens.wsn:resources
)) - (
update-interval
(line-mobilitylens.wsn:line-mobility
))
periodic-update-message
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'MESSAGE :NAME 'LENS.WSN::RESOURCE-PERIODIC-UPDATE)
- Initargs: none
- Allocation: instance
periodic-update-message
(periodic-update-message object)
- (
periodic-update-message
(resourceslens.wsn:resources
))
clock-drift
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Actual clock drift for this module initialised from clock-drift-sigma parameter.
clock-drift
(clock-drift object)
- (
clock-drift
(resourceslens.wsn:resources
))
Indirect Slots
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: routing
Inheritance
- Parent classes: comms-module
- Precedence list: routing, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: multipath-rings-routing, leach-routing, bypass-routing
Parameters
- max-net-frame-size
- a
integer
. Default:0
. The maximum packet size the routing can handle in bytes (0 for no limit)
Description
Base class for all routing modules. Base implementation Provides checking of maximum frame size allowed
Direct Slots
max-net-frame-size
- Value type:
integer
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units b)
The maximum packet size the routing can handle in bytes (0 for no limit)
max-net-frame-size
(max-net-frame-size object)
- (
max-net-frame-size
(routinglens.wsn:routing
))
Indirect Slots
header-overhead
- Value type:
integer
- Initial value:
10
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer-size
- Value type:
integer
- Initial value:
32
- Initargs: buffer-size
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: routing-packet
Inheritance
- Parent classes: wsn-packet
- Precedence list: routing-packet, wsn-packet, packet, message, event, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: multipath-rings-routing-packet, leach-routing-packet
Description
A generic routing packet header. An app packet will be encapsulated in it. If definining your own routing protocol and need a more specialized packet you have to create one the extends this generic packet. to-mac, enqueue and decapsulate specialisations provided. handle-message implementations which check destination address and forward to application and check frame size etc are provided. .
Direct Slots
Indirect Slots
sequence-number
- Value type:
t
- Initial value:
NIL
- Initargs: sequence-number, seqnum
- Allocation: instance
destination
- Value type:
t
- Initial value:
NIL
- Initargs: destination
- Allocation: instance
source
- Value type:
t
- Initial value:
NIL
- Initargs: source
- Allocation: instance
header-overhead
- Value type:
t
- Initial value:
0
- Initargs: byte-length, header-overhead
- Allocation: instance
bit-error-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
reception-start-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: deliver-on-reception-start
- Allocation: instance
control-info
- Value type:
t
- Initial value:
NIL
- Initargs: control-info
- Allocation: instance
duration
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
encapsulated-packet
- Value type:
packet
- Initial value:
NIL
- Initargs: encapsulated-packet
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: scenario-physical-process
Inheritance
- Parent classes: physical-process
- Precedence list: scenario-physical-process, physical-process, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- k
- a
real
. Default:0.25
. multiplicative parameter (k) - a
- a
real
. Default:1.0
. exponential attenuation exponent (a) for values vs distance*/k/ - sources
- a
read
. Default:`((,(MAKE-COORD 10.0 10.0) (0.0 . 30.5) (5.0 . 45) (12.0 . 7.3)))
. List of lists showing how sources evolve over time. Each source is represented as a coordinate and a list of conses of times and values in order.
Description
A Physical process made up of a number of discrete physical sources whose output evolves over time. The effect of multiple sources in a certain point is additive. At a certain location and time the physical process value is given by
\begin{equation} V(p,t) = \sum_{i=\text{all sources}} \frac{V_i(t)}{(K d_i(p_i,t))^a} \end{equation}where \(V(p,t)\) denotes the value of the physical process at point \(p\) and time \(t\), \(V_i(t)\) denotes the value of the \(i^{th}\) source at time \(t\), \(K\) and \(a\) are specified by module parameters k and a that determine how the value from a source diffused.
Direct Slots
k
- Value type:
real
- Initial value:
0.25
- Initargs: k
- Allocation: instance
- Parameter: t
- Properties: nil
a
- Value type:
real
- Initial value:
1.0
- Initargs: a
- Allocation: instance
- Parameter: t
- Properties: nil
sources
- Value type:
list
- Initial value:
`((,(MAKE-COORD 10.0 10.0) (0.0 . 30.5) (5.0 . 45) (12.0 . 7.3)))
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (format read)
List of lists showing how sources evolve over time. Each source is represented as a coordinate and a list of conses of times and values in order.
sources
(sources object)
- (
sources
(scenario-physical-processlens.wsn:scenario-physical-process
))
Indirect Slots
function
- Value type:
function
- Initial value: =#'(LAMBDA (LENS.WSN::M LENS.WSN::C LENS.WSN::TM) (DECLARE (IGNORE LENS.WSN::M LENS.WSN::C LENS.WSN::TM)) (UNIFORM 0.0 1.0))=
- Initargs: none
- Allocation: instance
description
- Value type:
string
- Initial value:
NIL
- Initargs: description
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: simple-aggregation
Inheritance
- Parent classes: application
- Precedence list: simple-aggregation, application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- priority
- a
t
. Default:1
. NIL - sink-network-address
- a
fixnum
. NIL - sample-interval
- a
time-type
. Default:1
. NIL
Description
Application providing an example of sensor reading aggregation with multipath-rings routing. The aggregated value is maximum of its sensor reading and received sensor reading from nodes further away (at higher level) in multipath-rings routing.
Direct Slots
priority
- Value type:
t
- Initial value:
1
- Initargs: priority
- Allocation: instance
- Parameter: t
- Properties: nil
priority
(priority object)
- (
priority
(throughput-testlens.wsn:throughput-test
)) - (
priority
(connectivity-maplens.wsn:connectivity-map
)) - (
priority
(simple-aggregationlens.wsn:simple-aggregation
)) - (
priority
(applicationlens.wsn:application
))
sink-network-address
- Value type:
fixnum
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
sink-network-address
(sink-network-address module)
- module
- an application or other wsn-module
Return the address of sink node for reporting applications. Default
is sink
however some applications take this as a parameter.
- (
sink-network-address
(simple-aggregationlens.wsn:simple-aggregation
)) - (
sink-network-address
(value-reportinglens.wsn:value-reporting
)) - (
sink-network-address
(leach-routinglens.wsn:leach-routing
)) - (
sink-network-address
(entitylens.wsn:application
)) - (
sink-network-address
(nodelens.wsn:node
)) - (
sink-network-address
(instancelens.wsn:wsn module
))
sample-interval
request-sample
send-aggregated-value
waiting-time-for-lower-level-data
aggregated-value
- Value type:
real
- Initial value:
0.0
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: throughput-test
Inheritance
- Parent classes: application
- Precedence list: throughput-test, application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- priority
- a
t
. Default:1
. NIL - next-recipient
- a
read
. Default:0
. Destination address for packets produced in this node. This parameter can be used to create an application-level static routing. This way we can have a multi-hop throughput test. - packet-rate
- a
real
. Default:0
. Packets per second - startup-delay
- a
time-type
. Default:0
. Delay in seconds before application starts producing packets
Description
This transmits packets of payload-overhead and header-overhead size and at given packet-rate after specified startup-delay. next-recipient may be used to set up static routing
Direct Slots
priority
- Value type:
t
- Initial value:
1
- Initargs: priority
- Allocation: instance
- Parameter: t
- Properties: nil
priority
(priority object)
- (
priority
(throughput-testlens.wsn:throughput-test
)) - (
priority
(connectivity-maplens.wsn:connectivity-map
)) - (
priority
(simple-aggregationlens.wsn:simple-aggregation
)) - (
priority
(applicationlens.wsn:application
))
next-recipient
- Value type:
t
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (format read)
Destination address for packets produced in this node. This parameter can be used to create an application-level static routing. This way we can have a multi-hop throughput test.
next-recipient
(next-recipient object)
- (
next-recipient
(throughput-testlens.wsn:throughput-test
))
packet-rate
- Value type:
real
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Packets per second
packets-rate
(packets-rate object)
- (
packets-rate
(throughput-testlens.wsn:throughput-test
))
startup-delay
- Value type:
time-type
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (units s)
Delay in seconds before application starts producing packets
startup-delay
(startup-delay object)
- (
startup-delay
(throughput-testlens.wsn:throughput-test
))
packet-spacing
- Value type:
real
- Initial value:
NIL
- Initargs: none
- Allocation: instance
packet-spacing
(packet-spacing object)
- (
packet-spacing
(throughput-testlens.wsn:throughput-test
)) - (
packet-spacing
(connectivity-maplens.wsn:connectivity-map
))
send-packet
- Value type:
timer-message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: tmac
Inheritance
- Parent classes: mac
- Precedence list: tmac, mac, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- print-state-transitions
- a
boolean
. Debugging parameter - ack-packet-size
- a
integer
. Default:11
. NIL - sync-packet-size
- a
integer
. Default:11
. NIL - rts-packet-size
- a
integer
. Default:13
. NIL - cts-packet-size
- a
integer
. Default:13
. NIL - max-mac-frame-size
- a
t
. Default:0
. NIL - header-overhead
- a
t
. Default:11
. NIL - buffer-size
- a
t
. Default:32
. NIL - max-tx-retries
- a
integer
. Default:2
. This number of transmission attempts of a single unicast packet
that TMAC will perform. A transmission is considered successful only if acknowledgment packet is received from the destination node. Sending an RTS packet is also considered as a transmission attempt. Note that this parameter does not apply to broadcast packets.
- allow-sink-sync
- a
boolean
. Default:T
. If true allows sink node to start synchronisation immediately to avoid contention interval when creating a synchronisation schedule for the network, thus allowing for faster synchronisation, and consequently, better throughput (especially if packets need to be sent early in the simulation) - use-frts
- a
boolean
. enable/disable FRTS (Future Request To Send). Although in the original TMAC protocol it is not supported here. - use-rts-cts
- a
boolean
. Default:T
. Enable/disable RTS/CTS handshake. If disabled (not in orginal TMAC) limits any transmission to a simple DATA - ACK exchange between nodes without the overhead of a reservation. More efficient for small packets. - disable-ta-extension
- a
boolean
. Disabling TA extension effectively creates an SMAC protocol if we also define an appropriate listen interval (10% of the whole frame). - conservative-ta
- a
boolean
. Default:T
. Conservative activation timeout - will always stay awake for at least 15 ms after any activity on the radio - resync-time
- a
time-type
. Default:6.0d0
. The interval between broadcasting synchronization packets (in seconds). The value of this parameter is directly related to the clock drift of nodes in the simulation network. 40 seconds is an adequate value to use with current clock drift model. - contention-period
- a
time-type
. Default:0.01
. The duration of contention interval (i.e. interval where transmissions of randomized), in milliseconds, for any transmission attempt. The major effect of this parameter is to avoid transmission interference from neighbouring nodes. - listen-timeout
- a
time-type
. Default:0.015
. The duration of listen timeout(can also be called activation timeout). This parameter defines the amount of time which has to pass without any activity on the wireless channel in order for a node to go to sleep in the current frame. - wait-timeout
- a
time-type
. Default:0.005
. The duration of timeout for expecting a reply from another node. This reply may be a CTS packet or an ACK packet. If no reply is received after this time interval, then transmission attempt is considered failed and transmission attempt counter is decremented. - frame-time
- a
time-type
. Default:0.61
. The length of each frame period for all nodes (in milliseconds). Nodes try to synchronise the start and end of each frame with a global schedule (with the possibility of more than one schedules). Note that this refers to the duration of the whole frame; the active and inactive portions of each frame are determined dynamically and individually for each node. - collision-resolution
- a
symbol
. Default: ='IMMEDIATE-RETRY=. Collision resolution mechanism, choose from- immediate-retry
- Low collision avoidance - retry immediately after losing channel)
- overhearing
- (default). Retry only when hear a CTS or RTS/
- retry-next-frame
- Aggressive collision avoidance - retry only in next frame.
Description
TMAC employs many techniques to keep the energy consumption low (using aggressive duty cycling and synchronization) while trying to keep performance (e.g. packet delivery) high by adapting its duty cycle according to the traffic needs. S-MAC is a predecessor of TMAC as it initiated many of the techniques but uses a more rigid duty cycle. This implementation is from CASTELIA - see::
Yuri Tselishchev, Athanassios Boulis, Lavy Libman, “Experiences and Lessons from Implementing a Wireless Sensor Network MAC Protocol in the Castalia Simulator,” submitted to IEEE Wireless Communications & Networking Conference 2010 (WCNC 2010), Sydney, Australia.
The parameters for SMAC are defined in the SMAC.ini configuration file.
Direct Slots
print-state-transitions
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
ack-packet-size
sync-packet-size
rts-packet-size
cts-packet-size
max-mac-frame-size
header-overhead
buffer-size
max-tx-retries
- Value type:
integer
- Initial value:
2
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
This number of transmission attempts of a single unicast packet that TMAC will perform. A transmission is considered successful only if acknowledgment packet is received from the destination node. Sending an RTS packet is also considered as a transmission attempt. Note that this parameter does not apply to broadcast packets.
allow-sink-sync
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
use-frts
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
use-rts-cts
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
disable-ta-extension
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
conservative-ta
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
resync-time
- Value type:
time-type
- Initial value:
6.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
contention-period
- Value type:
time-type
- Initial value:
0.01
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
listen-timeout
- Value type:
time-type
- Initial value:
0.015
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
wait-timeout
- Value type:
time-type
- Initial value:
0.005
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
frame-time
- Value type:
time-type
- Initial value:
0.61
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
The length of each frame period for all nodes (in milliseconds). Nodes try to synchronise the start and end of each frame with a global schedule (with the possibility of more than one schedules). Note that this refers to the duration of the whole frame; the active and inactive portions of each frame are determined dynamically and individually for each node.
collision-resolution
- Value type:
symbol
- Initial value: ='LENS.WSN.MAC.TMAC::IMMEDIATE-RETRY=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
state
- Value type:
tmac-state
- Initial value:
NIL
- Initargs: none
- Allocation: instance
state
(state instance)
- instance
- an object with state handling.
Return current state identifier of instance
- (
state
(mac802.15.4lens.wsn:mac802.15.4
)) - (
state
(tmaclens.wsn:tmac
)) - (
state
(tuneable-maclens.wsn:tuneable-mac
)) - (
state
(radiolens.wsn:radio
))
tx-addr
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
tx-retries
- Value type:
fixnum
- Initial value:
NIL
- Initargs: none
- Allocation: instance
primary-wakeup
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
need-resync
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
current-frame-start
- Value type:
time-type
- Initial value:
NIL
- Initargs: none
- Allocation: instance
activation-timeout
- Value type:
time-type
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-table
- Value type:
vector
- Initial value:
(MAKE-ARRAY 8 :ELEMENT-TYPE 'LENS.WSN.MAC.TMAC::TMAC-SCHEDULE :ADJUSTABLE T :FILL-POINTER 0)
- Initargs: none
- Allocation: instance
sync-packet
transmission-timeout
check-ta
carrier-sense
- Value type:
t
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: tuneable-mac
Inheritance
- Parent classes: mac
- Precedence list: tuneable-mac, mac, comms-module, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- duty-cycle
- a
float
. Default:1.0
. The fraction of time that the node stays on listening to the channe;: listening / (sleeping+listening) - listen-interval
- a
time-type
. Default:0.01
. This is the time the node stays on listening each cycle. - beacon-interval-fraction
- a
float
. Default:1.0
. This parameter expresses the fraction of the maximum beacon interval (= sleeping interval) that our beacon interval actually is. The smaller this is the less energy we spend, but the less chance we have to wake up a neighbour. - probability-tx
- a
float
. Default:1.0
. The probability of a single try of Transmission to happen. This value combined with the number of retransmissions can create any expected number of transmissions per node, even non integer values. - num-tx
- a
integer
. Default:1
. Number of times we try to retransmit something. - random-tx-offset
- a
time-type
. Default:0.0d0
. We start transmitting after time chosen randomly from interval [0..randomTxOffset] - retx-interval
- a
time-type
. Default:0.0d0
. Interval between retransmissions. - backoff-type
- a
symbol
. Default: ='CONSTANT=. Determines how backoff-interval is determine. Can be sleep-interval, constant, multiplying (e.g. 1*a, 2*a, 3*a, 4*a …),or exponential (e.g. 2, 4, 8, 16, 32…) - backoff-base-value
- a
time-type
. Default:0.016d0
. Base backoff time interval. See also parameter backoff-type - csma-persistence
- a
(number :min 0 :max 1 :coerce-to float)
. Default:0
. Value in range [0..1], 0 is CSMA non-persistent, p-persistent, or 1-persistent? - tx-all-packets-in-free-channel
- a
boolean
. Default:T
. If true, if you find the channel free, transmit all packets in buffer - sleep-during-backoff
- a
boolean
. For no dutyCycle case: sleep when backing off - beacon-frame-size
- a
integer
. Default:125
. Have a big beacon, to avoid much processing overhead, but fit at least 2 in the listening interval
Description
A highly tuneable MAC protocol implementation with broadcast communication in mind (it does not support unicast, acknowledgements or RTC/CTS control packets). It can be tuned in regards to its persistence and backing off policies. It can also be used to duty cycle the radio and to transmit an appropriate train of beacons before each data transmission to wake up potential receivers (since the nodes are not aligned in their sleeping schedules). It also provides several other parameterized functions such as retransmissions, probabilistic transmission, and randomized TX offsets.
Default parameter values will result in non-persistent CSMA-CA behaviour with no radio duty cycling.
Most parameters can be controlled by the application using
mac-control-message messages with the commands set-duty-cycle
,
set-listen-interval
, set-beacon-interval-fraction
, set-prob-tx
,
set-random-tx-offset
, set-retx-interval
, set-backoff-type
,
set-backoff-base-value. See the associated module parameters for
semantics and arguments.
Direct Slots
duty-cycle
- Value type:
float
- Initial value:
1.0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
The fraction of time that the node stays on listening to the channe;: listening / (sleeping+listening)
duty-cycle
(duty-cycle object)
- (
duty-cycle
(tuneable-maclens.wsn:tuneable-mac
))
listen-interval
- Value type:
time-type
- Initial value:
0.01
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
This is the time the node stays on listening each cycle.
listen-interval
(listen-interval object)
- (
listen-interval
(tuneable-maclens.wsn:tuneable-mac
))
beacon-interval-fraction
- Value type:
float
- Initial value:
1.0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
This parameter expresses the fraction of the maximum beacon interval (= sleeping interval) that our beacon interval actually is. The smaller this is the less energy we spend, but the less chance we have to wake up a neighbour.
beacon-interval-fraction
(beacon-interval-fraction object)
- (
beacon-interval-fraction
(tuneable-maclens.wsn:tuneable-mac
))
probability-tx
- Value type:
float
- Initial value:
1.0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
The probability of a single try of Transmission to happen. This value combined with the number of retransmissions can create any expected number of transmissions per node, even non integer values.
probability-tx
(probability-tx object)
- (
probability-tx
(tuneable-maclens.wsn:tuneable mac
))
num-tx
- Value type:
integer
- Initial value:
1
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Number of times we try to retransmit something.
random-tx-offset
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
We start transmitting after time chosen randomly from interval [0..randomTxOffset]
random-tx-offset
(random-tx-offset object)
- (
random-tx-offset
(tuneable-maclens.wsn:tuneable-mac
))
retx-interval
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Interval between retransmissions.
retx-interval
(retx-interval object)
- (
retx-interval
(tuneable-maclens.wsn:tuneable mac
))
backoff-type
- Value type:
symbol
- Initial value: ='LENS.WSN:CONSTANT=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Determines how backoff-interval is determine. Can be sleep-interval, constant, multiplying (e.g. 1*a, 2*a, 3*a, 4*a …),or exponential (e.g. 2, 4, 8, 16, 32…)
backoff-type
(backoff-type object)
- (
backoff-type
(tuneable-maclens.wsn:tuneable mac
))
backoff-base-value
- Value type:
time-type
- Initial value:
0.016d0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Base backoff time interval. See also parameter backoff-type
backoff-base-value
(backoff-base-value object)
- (
backoff-base-value
(tuneable-maclens.wsn:tuneable-mac
))
csma-persistence
- Value type:
float
- Initial value:
0
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (format (number min 0 max 1 coerce-to float))
Value in range [0..1], 0 is CSMA non-persistent, p-persistent, or 1-persistent?
csma-persistence
(csma-persistence object)
- (
csma-persistence
(tuneable-maclens.wsn:tuneable-mac
))
tx-all-packets-in-free-channel
- Value type:
boolean
- Initial value:
T
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
If true, if you find the channel free, transmit all packets in buffer
tx-all-packets-in-free-channel
(tx-all-packets-in-free-channel object)
- (
tx-all-packets-in-free-channel
(tuneable-maclens.wsn:tuneable-mac
))
sleep-during-backoff
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
For no dutyCycle case: sleep when backing off
sleep-during-backoff
(sleep-during-backoff object)
- (
sleep-during-backoff
(tuneable-maclens.wsn:tuneable-mac
))
beacon-frame-size
- Value type:
integer
- Initial value:
125
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Have a big beacon, to avoid much processing overhead, but fit at least 2 in the listening interval
beacon-frame-size
(beacon-frame-size object)
- (
beacon-frame-size
(tuneable-maclens.wsn:tuneable-mac
))
state
- Value type:
tuneable-mac-state
- Initial value: ='LENS.WSN.MAC.TUNEABLE::DEFAULT=
- Initargs: none
- Allocation: instance
state
(state instance)
- instance
- an object with state handling.
Return current state identifier of instance
- (
state
(mac802.15.4lens.wsn:mac802.15.4
)) - (
state
(tmaclens.wsn:tmac
)) - (
state
(tuneable-maclens.wsn:tuneable-mac
)) - (
state
(radiolens.wsn:radio
))
num-tx-tries
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
num-tx-tries
(num-tx-tries object)
- (
num-tx-tries
(tuneable-maclens.wsn:tuneable mac
))
backoff-times
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
number of consequtive backoff times
backoff-times
(backoff-times object)
- (
backoff-times
(tuneable-maclens.wsn:tuneable mac
))
remaining-beacons-to-tx
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
remaining-beacons-to-tx
(remaining-beacons-to-tx object)
- (
remaining-beacons-to-tx
(tuneable-maclens.wsn:tuneable-mac
))
sleep-interval
- Value type:
time-type
- Initial value:
NIL
- Initargs: none
- Allocation: instance
sleep-interval
(sleep-interval object)
- (
sleep-interval
(tuneable-maclens.wsn:tuneable mac
))
sleep-listen-timer
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
sleep-listen-timer
(sleep-listen-timer object)
- (
sleep-listen-timer
(tuneable-maclens.wsn:tuneable-mac
))
start-cs-timer
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE :NAME 'LENS.WSN.MAC.TUNEABLE::START-CS-TIMER)
- Initargs: none
- Allocation: instance
start-cs-timer
(start-cs-timer object)
- (
start-cs-timer
(tuneable-maclens.wsn:tuneable mac
))
attempt-tx-timer
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE :NAME 'LENS.WSN.MAC.TUNEABLE::ATTEMPT-TX-TIMER)
- Initargs: none
- Allocation: instance
attempt-tx-timer
(attempt-tx-timer object)
- (
attempt-tx-timer
(tuneable-maclens.wsn:tuneable-mac
))
send-beacons-or-data-timer
- Value type:
message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE :NAME 'LENS.WSN.MAC.TUNEABLE::SEND-BEACONS-OR-DATA-TIMER)
- Initargs: none
- Allocation: instance
send-beacons-or-data-timer
(send-beacons-or-data-timer object)
- (
send-beacons-or-data-timer
(tuneable-maclens.wsn:tuneable-mac
))
Indirect Slots
address
- Value type:
integer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
last-sequence-number
packet-history
- Value type:
history-buffer
- Initial value: =(MAKE-INSTANCE 'HISTORY-BUFFER :ELEMENT-TYPE 'PACKET :KEY #'(LAMBDA (LENS.WSN::P) (CONS (LENS.WSN:SOURCE LENS.WSN::P) (LENS.WSN:SEQUENCE-NUMBER LENS.WSN::P))))=
- Initargs: none
- Allocation: instance
buffer
- Value type:
packet-buffer
- Initial value:
NIL
- Initargs: none
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: value-propagation
Inheritance
- Parent classes: application
- Precedence list: value-propagation, application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- temp-threshold
- a
t
. Default:15
. NIL
Description
Application class which will continually sample sensors and will transmit maximum of its sensor reading or received sensor reading once over the network.
Direct Slots
temp-threshold
total-packets
- Value type:
fixnum
- Initial value:
0
- Initargs: none
- Allocation: instance
total-packets
(total-packets object)
- (
total-packets
(value-propagationlens.wsn:value-propagation
))
current-max-received-value
- Value type:
float
- Initial value:
-1000.0
- Initargs: none
- Allocation: instance
current-max-received-value
(current-max-received-value object)
- (
current-max-received-value
(value-propagationlens.wsn:value-propagation
))
current-max-sensed-value
- Value type:
float
- Initial value:
-1000.0
- Initargs: none
- Allocation: instance
current-max-sensed-value
(current-max-sensed-value object)
- (
current-max-sensed-value
(value-propagationlens.wsn:value-propagation
))
the-value
- Value type:
float
- Initial value:
0
- Initargs: none
- Allocation: instance
the-value
(the-value object)
- (
the-value
(value-propagationlens.wsn:value-propagation
))
Indirect Slots
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
integer
- Initial value:
1
- Initargs: priority
- Allocation: instance
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: value-reporting
Inheritance
- Parent classes: application
- Precedence list: value-reporting, application, wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: None.
Parameters
- sink-network-address
- a
fixnum
. NIL - max-sample-interval
- a
time-type
. Default:60.0
. NIL - min-sample-interval
- a
time-type
. Default:1.0
. NIL
Description
Document class which will continually sample sensors and send data to sink-network-address over network
Direct Slots
sink-network-address
- Value type:
fixnum
- Initial value:
NIL
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
sink-network-address
(sink-network-address module)
- module
- an application or other wsn-module
Return the address of sink node for reporting applications. Default
is sink
however some applications take this as a parameter.
- (
sink-network-address
(simple-aggregationlens.wsn:simple-aggregation
)) - (
sink-network-address
(value-reportinglens.wsn:value-reporting
)) - (
sink-network-address
(leach-routinglens.wsn:leach-routing
)) - (
sink-network-address
(entitylens.wsn:application
)) - (
sink-network-address
(nodelens.wsn:node
)) - (
sink-network-address
(instancelens.wsn:wsn module
))
max-sample-interval
min-sample-interval
random-back-off-interval-fraction
request-sample
- Value type:
timer-message
- Initial value:
(MAKE-INSTANCE 'TIMER-MESSAGE)
- Initargs: none
- Allocation: instance
Indirect Slots
last-sequence-number
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
integer
- Initial value:
1
- Initargs: priority
- Allocation: instance
applicationid
- Value type:
symbol
- Initial value:
NIL
- Initargs: id
- Allocation: instance
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: wireless-channel
Inheritance
- Parent classes: compound-module
- Precedence list: wireless-channel, compound module, module, component, parameter-object, entity-with signals, owned-object, named object, lens-object, standard object, slot-object, t
- Direct subclasses: None.
Parameters
- cell-size
- a
coord
. Default:(MAKE-COORD 5.0 5.0 1.0)
. Size of cells in each dimension (for mobility) - signal-delivery-threshold
- a
real
. Default:-100.0
. threshold in dBm above which, wireless channel module is delivering signal messages to radio modules of individual nodes
Description
The wireless channel module simulates the wireless medium. Nodes sent packets to it and according to various conditions (fading, interference etc) it is decided which nodes can receive this packet.
Direct Slots
cell-size
- Value type:
coord
- Initial value:
(MAKE-COORD 5.0 5.0 1.0)
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Size of cells in each dimension (for mobility)
cell-size
(cell-size object)
- (
cell-size
(wireless-channellens.wsn:wireless-channel
))
field
- Value type:
coord
- Initial value:
NIL
- Initargs: none
- Allocation: instance
wireless coverage field (may be larger than network field
field
(field object)
- (
field
(wireless-channellens.wsn:wireless-channel
)) - (
field
(wsnlens.wsn:wsn
))
signal-delivery-threshold
- Value type:
real
- Initial value:
-100.0
- Initargs: signal-delivery-threshold
- Allocation: instance
- Parameter: t
- Properties: nil
threshold in dBm above which, wireless channel module is delivering signal messages to radio modules of individual nodes
signal-delivery-threshold
(signal-delivery-threshold object)
- (
signal-delivery-threshold
(wireless-channellens.wsn:wireless-channel
))
temporal-model
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
the temporal channel variation model
temporal-model
(temporal-model object)
- (
temporal-model
(wireless-channellens.wsn:wireless-channel
))
max-tx-power
- Value type:
real
- Initial value:
0.0
- Initargs: none
- Allocation: instance
max-tx-power
(max-tx-power object)
- (
max-tx-power
(wireless-channellens.wsn:wireless-channel
))
receivers
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
an array of lists of receiver gateways affected by ongoing transmission.
receivers
(receivers object)
- (
receivers
(wireless-channellens.wsn:wireless-channel
))
cells
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
an array of cell entities with node occupation and path-loss to other cells
cells
(cells object)
- (
cells
(wireless-channellens.wsn:wireless-channel
))
location-cells
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Cached location cell by node instance
Indirect Slots
submodules
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: wsn
Inheritance
- Parent classes: network
- Precedence list: wsn, network, compound-module, module, component, parameter-object, entity-with-signals, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: None.
Parameters
- field
- a
coord
. Default:(MAKE-COORD 30.0d0 30.0d0)
. Size of network deployment field - num-nodes
- a
fixnum
. Default:30
. Number of nodes in network - num-physical-processes
- a
fixnum
. Default:1
. Number of physical processes - deployment
- a
read
. Default: ='UNIFORM=. Node deployment specification. See mobility module on valid values for this and it's semantics.
Description
Network for all Wirelesss sensor networks bringing together a wireless-channel, a set of sensing nodes representing motes and a number of physical-processs being sensed..
Direct Slots
field
- Value type:
coord
- Initial value:
(MAKE-COORD 30.0d0 30.0d0)
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Size of network deployment field
field
(field object)
- (
field
(wireless-channellens.wsn:wireless-channel
)) - (
field
(wsnlens.wsn:wsn
))
num-nodes
- Value type:
fixnum
- Initial value:
30
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Number of nodes in network
num-physical-processes
- Value type:
fixnum
- Initial value:
1
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: nil
Number of physical processes
num-physical-processes
(num-physical-processes object)
- (
num-physical-processes
(wsnlens.wsn:wsn
))
deployment
- Value type:
list
- Initial value: ='UNIFORM=
- Initargs: none
- Allocation: instance
- Parameter: t
- Properties: (format read)
Node deployment specification. See mobility module on valid values for this and it's semantics.
Indirect Slots
submodules
gate-slots
- Value type:
hash-table
- Initial value:
NIL
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: wsn-module
Inheritance
- Parent classes: with-timers, module
- Precedence list: wsn-module, with-timers, module, component, parameter-object, entity-with-signals, owned-object, named-object, lens-object, standard-object, slot-object, t
- Direct subclasses: comms-module, application, sensor, resources, mobility
Parameters
None.
Description
wsn-modules represent all modules inside a node on thenetwork. They inherit timers from with-timers however the timers use get-simulation-time so that they take account of clock drift on the node (see the resources module). They subscribe to the node-shutdown and node-startup event signals to startup and shutdown the module All submodules of a node will receive this signal. For shutdown modules disabled-p is true.
Direct Slots
disabled-p
- Value type:
t
- Initial value:
T
- Initargs: disabled-p
- Allocation: instance
True if module is disabled (does not receive messages)
disabled-p
(disabled-p object)
- (
disabled-p
(wsn-modulelens.wsn:wsn-module
)) - (
disabled-p
(delay-channeldelay-channel
))
Indirect Slots
timers
- Value type:
list
- Initial value:
NIL
- Initargs: none
- Allocation: instance
gate-slots
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
Hash table mapping gate names to gate-slot
instances as specified in the :gates
slot option in the class
specification of subclasses.
initialized-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rng-map
- Value type:
array
- Initial value:
NIL
- Initargs: none
- Allocation: instance
collect-trace-info
- Value type:
boolean
- Initial value:
NIL
- Initargs: none
- Allocation: instance
properties
- Value type:
t
- Initial value:
NIL
- Initargs: properties
- Allocation: instance
has-ancestor-listeners
- Value type:
simple-bit-vector
- Initial value:
NIL
- Initargs: none
- Allocation: instance
has-local-listeners
- Value type:
simple-bit-vector
- Initial value:
(MAKE-ARRAY +SIGNAL-CACHE-SIZE+ :ELEMENT-TYPE 'BIT :INITIAL-ELEMENT 0)
- Initargs: none
- Allocation: instance
signal-table
- Value type:
hash-table
- Initial value:
(MAKE-HASH-TABLE)
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
Class: wsn-packet
Inheritance
- Parent classes: packet
- Precedence list: wsn-packet, packet, message, event, owned object, named-object, lens object, standard-object, slot object, t
- Direct subclasses: mac-packet, routing-packet
Description
Base class for network and link layer packets. Have a source and destination address relevant to the protocol layer and a header-overhead. Also provides sequence-number for identifying packets.
Direct Slots
header-overhead
- Value type:
t
- Initial value:
0
- Initargs: byte-length, header-overhead
- Allocation: instance
In bytes
header-overhead
(header-overhead object)
- (
header-overhead
(comms-modulelens.wsn:comms-module
)) - (
header-overhead
(wsn-packetlens.wsn:wsn-packet
)) - (
header-overhead
(applicationlens.wsn:application
)) - (
header-overhead
(wireless-signal-endlens.wsn::wireless-signal-end
))
source
- Value type:
t
- Initial value:
NIL
- Initargs: source
- Allocation: instance
the source address of the received packet
source
(source object)
- (
source
(wsn-packetlens.wsn:wsn-packet
)) - (
source
(app-net-control-infolens.wsn:app-net-control-info
))
destination
- Value type:
t
- Initial value:
NIL
- Initargs: destination
- Allocation: instance
the destination address of the packet to be sent
destination
(destination object)
- (
destination
(wsn-packetlens.wsn:wsn-packet
)) - (
destination
(app-net-control-infolens.wsn:app-net-control-info
))
sequence-number
- Value type:
t
- Initial value:
NIL
- Initargs: sequence-number, seqnum
- Allocation: instance
a field to distinguish between packets
sequence-number
(sequence-number object)
- (
sequence-number
(wsn-packetlens.wsn:wsn-packet
)) - (
sequence-number
(application-packetlens.wsn:application-packet
))
Indirect Slots
bit-error-p
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
reception-start-p
- Value type:
boolean
- Initial value:
NIL
- Initargs: deliver-on-reception-start
- Allocation: instance
control-info
- Value type:
t
- Initial value:
NIL
- Initargs: control-info
- Allocation: instance
duration
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: none
- Allocation: instance
encapsulated-packet
- Value type:
packet
- Initial value:
NIL
- Initargs: encapsulated-packet
- Allocation: instance
timestamp
- Value type:
time-type
- Initial value:
0.0d0
- Initargs: timestamp
- Allocation: instance
to
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
from
- Value type:
t
- Initial value:
NIL
- Initargs: none
- Allocation: instance
creation-time
- Value type:
time-type
- Initial value:
(SIMULATION-TIME)
- Initargs: none
- Allocation: instance
The creation time of the message. With cloned messages (see duplicate later), the creation time of the original message is returned and not the time of the cloning operation. This is particularly useful when modeling communication protocols, because many protocols clone the transmitted packages to be able to do retransmissions and/or segmentation/reassembly.
root-event
- Value type:
event
- Initial value:
NIL
- Initargs: none
- Allocation: instance
schedule-id
- Value type:
integer
- Initial value:
-1
- Initargs: none
- Allocation: instance
priority
- Value type:
fixnum
- Initial value:
0
- Initargs: priority
- Allocation: instance
arrival-time
- Value type:
time-type
- Initial value:
-1.0d0
- Initargs: time
- Allocation: instance
sent-time
- Value type:
double-float
- Initial value:
NIL
- Initargs: none
- Allocation: instance
rank
- Value type:
fixnum
- Initial value:
-1
- Initargs: none
- Allocation: instance
owner
- Value type:
named-object
- Initial value:
NIL
- Initargs: owner
- Allocation: instance
index
- Value type:
fixnum
- Initial value:
NIL
- Initargs: index
- Allocation: instance
name
- Value type:
symbol
- Initial value:
NIL
- Initargs: name
- Allocation: instance
Name of this object - used when addressing the object internally or through simulation paramaters.
5.3.2 External Structures
Structure: cell
Description
An area of radio coverage with the list of nodes wthin it and a list of path-loss records to other cells.
5.3.4 External Constants
Constant: broadcast-network-address
Value
-1
Type: fixnum
Description
Not documented.
5.3.5 External Global Variables
External Variable: network
Value
NIL
Type: null
Description
Network name for current run
5.3.6 External Functions
Function: attempt-tx
Syntax
(attempt-tx module &optional description)
Arguments
- module
- a wsn-module (usually a mac instance)
- description
- a string
Function: data-rate
Syntax
(data-rate entity)
External Function: exponential
Syntax
(exponential mean &optional (rng 0))
Arguments
- mean
- a
real
number
Optional Arguments
- rng
- an
integer
(default 0)
External Function: exponential
Syntax
(exponential mean &optional (rng 0))
Arguments
- mean
- a
real
number
Optional Arguments
- rng
- an
integer
(default 0)
Function: get-clock
Syntax
(get-clock instance)
Arguments
- module
- a wsn-module
Description
Return local value for absolute time taking account of the clock drift for the local clock as determined by the resources module.
Function: get-simulation-time
Syntax
(get-simulation-time module local-time)
Arguments
- module
- a wsn-module
- local-time
- a time-type
Description
Convert a time value local-time value into a simulation time taking account of the clock drift for the local clock as determined by the resources module.
Function: handle-control-command
Syntax
(handle-control-command module command argument)
Arguments
- module
- a wsn-module representation a communications protocol
- command
- a
symbol
representing the control command. - argument
- a
list
of other arguments associated with this command
Function: handle-sensor-reading
Syntax
(handle-sensor-reading application measurement)
Arguments
- application
- a application
- measurement
- a measurement or a
real
Description
Called to pass a measured value from a sensor to an application module. It must be specialised for all applications which
Must be implemented by applications to handle sensor readings
Function: measure
Syntax
(measure physical-process measurand location time)
Arguments
- physical-process
- a physical-process
- measurand
- a http://www.lispworks.com/reference/HyperSpec//symbol signifying what is being measured
- location
- a coord
- time
- a time-type
Description
Return the real value of specified measurand from a physical process at given time and location. Must be specialised for all physical-processs.
Function: node
Syntax
(node module)
Arguments
- module
- a wsn-module
Description
Return the parent node module for module/.
Function: nodes
Syntax
(nodes network)
Arguments
- network
- a network
Function: packet-size
Syntax
(packet-size application data)
Arguments
- application
- an application module
- data
- application data
Description
Returns the size in bytes to be used as the byte-length of application packets sent by application when sending data. Default implementation returns the sum of the header-overhead
and payload-overhead
parameters of the application.
Function: parent-network-address
Syntax
(parent-network-address entity)
Attributes
- entity
- an application or other wsn-module
Function: ram-store
Syntax
(ram-store instance num-bytes)
Function: resolve-network-address
Syntax
(resolve-network-address routing network-address)
Arguments
- routing
- a routing module
- network-address
- a network-address designator
Function: sensor-request
Syntax
(sensor-request application &optional (sensor-index 0))
Arguments
- application
- a application
Optional Arguments
- sensor-index
- an
integer
(default 0)
Description
Sends a request for a reading from application to the sensor indicated by sensor-index. There may be a delay in the reading. The application must implement handle-sensor-reading to receive the returned measured value.
Function: set-state
Syntax
(set-state instance state &optional description)
Arguments
- instance
- an module with state handling.
- state
- a new state identifier
- description
- a string description of reason for state change.
Description
For modules with the [print-state-transitions] parameter and the state slot update the state slot to new value and if print-state-transitions is true print the change using tracelog. description may be used to add comments for tracing.
Function: shutdown
Syntax
(shutdown module)
Arguments
- module
- a wsn-module
Description
Called to shutdown a module when it receives the node-shutdown signal.
Function: sink-network-address
Syntax
(sink-network-address module)
Attributes
- module
- an application or other wsn-module
Inherited Function: sleep
Syntax
(sleep seconds)
Inherited Function: sleep
Syntax
(sleep seconds)
Function: startup
Syntax
(startup module)
Arguments
- module
- a wsn-module
Description
Called to start a module when it receives the node-startup signal.
Internal Function: state
Syntax
(state instance)
Arguments
- instance
- an object with state handling.
Function: symbol-length
Syntax
(symbol-length entity)
Function: to-mac
Syntax
(to-mac routing entity &optional next-hop-mac-address)
Arguments
- routing
- a routing implementation
- entity
- a message or communications-control-command
- next-hop-mac-address
- MAC address for MAC layer to forward to
Function: to-network
Syntax
(to-network application entity &optional destination)
Arguments
- application
- an application or mac
- entity
- a application-packet or communications-control-command from an application or routing-packet from a mac
Optional Arguments
- destination
- a network routing destination address
Description
Send message, packet or data to a routing module. This may be an application-packet or communications-control-command from an application module.
Function: to-radio
Syntax
(to-radio mac entity)
Arguments
- mac
- a mac module instance
- entity
- a radio-control-command or mac-packet or a cons of a control command and arguments
Description
Send a packet or control command to a radio module via the radio gate.
Function: transition-delay
Syntax
(transition-delay entity state1 state2)
Arguments
- entity
- a state machine
- state1
- a state representation
- state2
- a state representation
Function: tx-time
Syntax
(tx-time entity no-octets)
Arguments
- entity
- a radio or mac module
- no-octets
- an integer or mac-packet
Function: wireless-channel
Syntax
(wireless-channel object)
Description
Not documented.
5.4 Ambiguous Symbols
5.4.1 Wireless-Channel
- Function:
lens.wsn:wireless-channel
- Class:
lens.wsn:wireless-channel
5.4.2 Radio
- Function:
lens.wsn:radio
- Class:
lens.wsn:radio
5.4.3 Physical-Process
- Function:
lens.wsn:physical-process
- Class:
lens.wsn:physical-process
5.4.4 Node
- Function:
lens.wsn:node
- Class:
lens.wsn:node
5.5 Index
5.5.1 A
lens.wsn:app-net-control-info
, Classlens.wsn:application
, Classlens.wsn:application-packet
, Classlens.wsn:applicationid
, Functionlens.wsn:argument
, Functionlens.wsn:attempt-tx
, Function
5.5.2 B
lens.wsn:bits-per-symbol
, Functionlens.wsn:broadcast-mac-address
, Constantlens.wsn:broadcast-network-address
, Constantlens.wsn:buffer
, Functionbuffer-size
, Functionbuffer-size
, Functionlens.wsn:bypass-mac
, Classlens.wsn:bypass-routing
, Class
5.5.3 C
lens.wsn:cell
, Structurelens.wsn:channel-clear-status
, Functionlens.wsn:clock-drift
, Functionlens.wsn:collision-model
, Functionlens.wsn:command
, Functionlens.wsn:comms-module
, Classlens.wsn:communications
, Classlens.wsn:connectivity-map
, Class
5.5.4 D
lens.wsn:data-rate
, Functionlens.wsn:deployment
, Functionlens.wsn:description
, Functionlens.wsn:destination
, Functionlens.wsn:direct-node-physical process
, Classdisabled-p
, Functiondisabled-p
, Function
5.5.5 E
exponential
, Functionexponential
, Function
5.5.6 F
lens.wsn:field
, Function
5.5.7 G
lens.wsn:get-clock
, Functionlens.wsn:get-simulation-time
, Function
5.5.8 H
lens.wsn:handle-control-command
, Functionlens.wsn:handle-sensor-reading
, Functionlens.wsn:header-overhead
, Function
5.5.9 L
lens.wsn:last-hop
, Functionlens.wsn:last-sequence-number
, Functionlens.wsn:leach-routing
, Classlens.wsn:line-mobility
, Classlens.wsn:location
, Functionlens.wsn:lqi
, Function
5.5.10 M
lens.wsn:mac
, Classlens.wsn:mac-address
, Functionlens.wsn:mac-control-command
, Classlens.wsn:mac-control-message
, Classlens.wsn:mac-packet
, Classlens.wsn:mac-radio-control-info
, Classlens.wsn:mac802.15.4
, Classlens.wsn:max-mac-frame-size
, Functionlens.wsn:max-net-frame-size
, Functionlens.wsn:measure
, Functionlens.wsn:mobility
, Classlens.wsn:multipath-rings-routing
, Class
5.5.11 N
lens.wsn:net-mac-control-info
, Classnetwork
, Variablenetwork
, Functionnetwork
, Classnetwork
, Variablenetwork
, Functionnetwork
, Classlens.wsn:network-address
, Functionlens.wsn:network-control-command
, Classlens.wsn:network-control-message
, Classlens.wsn:next-hop
, Functionlens.wsn:next-sequence-number
, Functionlens.wsn:no-mobility
, Classlens.wsn:node
, Functionlens.wsn:node
, Classlens.wsn:nodeid
, Functionlens.wsn:nodes
, Functionlens.wsn:num-nodes
, Function
5.5.12 P
lens.wsn:packet-history
, Functionlens.wsn:packet-size
, Functionlens.wsn:parent-network-address
, Functionlens.wsn:payload
, Functionlens.wsn:payload-overhead
, Functionlens.wsn:physical-process
, Functionlens.wsn:physical-process
, Classlens.wsn:priority
, Function
5.5.13 R
lens.wsn:radio
, Functionlens.wsn:radio
, Classlens.wsn:radio-control-command
, Classlens.wsn:radio-control-command-name
, Typelens.wsn:radio-control-message
, Classlens.wsn:ram-store
, Functionlens.wsn:read-rssi
, Functionlens.wsn:resolve-network-address
, Functionlens.wsn:resources
, Classlens.wsn:routing
, Classlens.wsn:routing-packet
, Classlens.wsn:rssi
, Function
5.5.14 S
lens.wsn:scenario-physical-process
, Classlens.wsn:sensor-request
, Functionlens.wsn:sequence-number
, Functionlens.wsn:set-state
, Functionlens.wsn:shutdown
, Functionlens.wsn:simple-aggregation
, Classlens.wsn:sink-network-address
, Functionlens.wsn:sink-p
, Functionsleep
, Functionsleep
, Functionlens.wsn:sleep-interval
, Functionlens.wsn:source
, Functionlens.wsn:startup
, Functionlens.wsn:state
, Functionlens.wsn:symbol-length
, Function
5.5.15 T
lens.wsn:throughput-test
, Classlens.wsn:tmac
, Classlens.wsn:to-mac
, Functionlens.wsn:to-network
, Functionlens.wsn:to-radio
, Functionlens.wsn:transition-delay
, Functionlens.wsn:tuneable-mac
, Classlens.wsn:tx-time
, Function
5.5.16 V
lens.wsn:value-propagation
, Classlens.wsn:value-reporting
, Class
5.5.17 W
lens.wsn:wireless-channel
, Functionlens.wsn:wireless-channel
, Classlens.wsn:wsn
, Classlens.wsn:wsn-module
, Classlens.wsn:wsn-packet
, Class
6 Colophon
This documentation was generated from Common Lisp source code using CLOD, version 1.0. The latest version of CLOD is available here.
Footnotes:
1 This is a substantial difference from OMNET were all behaviour had to be in simple modules and a common pattern was to have to create simple modules that would then modify the connectivity in their parent compound modules
2 Another significant difference from OMNET++ where the parameters were declared in the ned files and had to be explicitely read in the C++ implementation code to configure the modules.