diff --git a/.cproject b/.cproject
new file mode 100644
index 00000000..45124c37
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..10b0ded3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+/src/CastaliaBin
+/src/CastaliaBin_dbg
+/out
+*_m.h
+*_m.cc
+src/Makefile
+.cmdenv-log
+.qtenvrc
+.vscode
+Castalia-Trace.txt
\ No newline at end of file
diff --git a/.nedexclusions b/.nedexclusions
new file mode 100644
index 00000000..e69de29b
diff --git a/.nedfolders b/.nedfolders
new file mode 100644
index 00000000..85de9cf9
--- /dev/null
+++ b/.nedfolders
@@ -0,0 +1 @@
+src
diff --git a/.oppbuildspec b/.oppbuildspec
new file mode 100644
index 00000000..252aae37
--- /dev/null
+++ b/.oppbuildspec
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.oppfeaturestate b/.oppfeaturestate
new file mode 100644
index 00000000..5b7b1d12
--- /dev/null
+++ b/.oppfeaturestate
@@ -0,0 +1,2 @@
+
+
diff --git a/.project b/.project
new file mode 100644
index 00000000..f619080d
--- /dev/null
+++ b/.project
@@ -0,0 +1,38 @@
+
+
+ castalia
+
+
+
+
+
+ org.omnetpp.cdt.MakefileBuilder
+
+
+
+
+ org.omnetpp.scave.builder.vectorfileindexer
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ org.omnetpp.main.omnetppnature
+
+
diff --git a/Castalia/CHANGES.txt b/CHANGES.txt
similarity index 96%
rename from Castalia/CHANGES.txt
rename to CHANGES.txt
index c3c38036..511d2138 100644
--- a/Castalia/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,214 +1,220 @@
-Castalia 3.3: Changes from 3.2
-------------------------------------------
-- Redesigned 802.15.4 MAC module. Modular to allow expansion.
- Several bug fixes due to the redesign. Now there is a base
- module to implement the basis of the protocol and then further
- modules can be developed to take decisions not specified by the
- protocol. An an example we offer StaticGTS which is a module
- that assigns statically GTS slots.
-
-- Wireless channel interface created. Base module moved to
- defaultChannel. SensorNetwork.ned changed accordignly.
- TraceChannel added
-
-- Castalia script offers new progress output
- CastaliaResults supports better averaging
- CastaliaPlot offers new labels to handle legends
-
-- New output by several modules
- ThroughputTest: Packet success and loss rate, maximum delay
- Resource manager: Remaining energy, network lifetime, dead nodes
- Simulation: execution time, sim/exec time ratio
-
-- Bug fixes in BaselineBanMac (pastSyncInterval flag and
- transmitting when UNCONNECTED). Some output renaming to
- match 802.15.4 outputs (for easy comparison)
-
-- Bug fixes in TMAC TunableMAC bug fixes regarding decapsulate,
- and TMAC using own seqNum
-
-
-
-Castalia 3.2: Changes from 3.1
-------------------------------------------
-- Bug fixes:
- -sleeping bug in 802.15.4 MAC
- -possible segfault in TimerService code
- -bugs with DESTROY_NODE and OUT_OF_ENERGY msgs
- -bug with NODE_STARTUP. Now the Radio and
- Resource Mgr receive and are affected by
- the node startup msg
- -readRSSI was returning -197dBm when no signal
- was received. Now the noiseFloor is returned
- -error accumulating in rare cases due to
- subtract_dBm(). Now this method is not used.
-
-- TunableMAC: changed the beacon TX to not leave
- gaps. Collect richer output
-
-- Better structured and cleaned the Virtual app/
- rouring/MAC classes and associated generic packets.
-
-- VirtualApp: empty appID means no filtering of packets
-
-- Added --title and --scale flags to CastaliaPlot,
- added check for valid gnuplot executable
-
-- Images (png, gif, jpg) produced with CastaliaPlot
- contain in the header metadata the full command
- that produced them.
-
-
-Castalia 3.1: Changes from 3.0
-------------------------------------------
-- Introduction of CastaliaPlot to create graphs
- automatically based on CastaliaResults output
-
-- Features added to CastaliaResults
- e.g., options --all --sum -v
-
-- Enhanced Tunable MAC with CSMA persistence
- options, and TX options
-
-- Dublicate packets handled in virtual routing
- and virtual MAC modules
-
-- Radio module enhanced to handle TXing without
- interruption
-
-- Minor cleanup and bug fixes:
- Cleaned up throughput app,
- bugs in GTS 802.15.4MAC
- bug in multipathRings
-
-
-
-Castalia 3.0: Major changes from 2.3
-------------------------------------------
-- Porting to OMNeT++ 4.x
-
-- Major restructuring of input and output
- 1) Standard way to create output and trace files
- 2) Introduced Castalia script to assist in
- creating complex simulation scenarios without
- the need for custom scripting solutions
- 3) Introduced CastaliaResults script to assist
- in processing the output easily without the
- need for custom scripting solutions
-
-- Created virtual classes for app, net, and MAC.
- New apps or protocols can be easily derived
- from these classes, which provide considerable
- abstraction tools and services.
-
-- Independent service of timers to be used with
- the app routing and MAC modules
-
-- Complete redefinition of Radio module
- 1) Radio receives signals from the channel.
- Reception/interference calculations done
- in radio now (instead of channel)
- 2) More accurate interference calculation
- (dynamic intereference accounted not just max)
- 3) Ability to calculate number of bit errors
- in a packet (not just 0/1)
- 4) Multiple RX modes (with different power consumed,
- datarate, modulation) that can change dynamically
- 5) Multiple sleep levels.
- 6) Transition times and power easily defined
- 7) Multiple carrier frequencies, than ca change dynamically
- 8) RSSI calculation is modeled more accurately taking
- into account the history of signals a radio experiences
-
-- Implementation of the Baseline BAN MAC as described
- in the IEEE 802.15 Task Group 6 proposal.
-
-
-Castalia 2.3: Changes from ver 2.2
-------------------------------------------
-- Implemented GTS mode in 802.15.4 MAC,
- fixed several bugs.
-- TMAC enhanced to select mechanisms for TA
- extension and collision resolution
-- Minor modifications in bridgeTestRun script
- added average energy consumption
-- Batch script for running BAN simulations added
-
-
-Castalia 2.2: Changes from ver 2.1
-------------------------------------------
-- Implementation of 802.15.4 MAC (CAP, beacon mode)
-- added modulation types diffBPSK, diffQPSK
-- throughtputTest application measuring latency
-- throughtputTest app supporting multihop traffic
- with nextRecipient parameter
-- Bug with TMAC sending many RTS packets fixed
-
-
-
-Castalia 2.1: Changes from ver 2.0
-------------------------------------------
-- T-MAC fully tested and debugged
-- S-MAC implemented as variant of T-MAC
-- Replaced buffer implementations with std
-- parsePRRMap() debugged and complete functionality
-- Automated test suite implemented, look in Tests/
-- 3 more parameters for sensing devices
-
-
-
-Castalia 2.0: Major changes from ver 1.3
-------------------------------------------
-
-== Wireless channel module
-1. Mobility support (!)
-2. Time-varying links (!)
-3. 3D coordinates and orientation
-4. the 2 directions of a link correlated
- with a dedicated parameter
-
-== Radio Module
-1. Custom modulation allowed by defining
- a SNR->BER array.
-2. variance in TX power introduced. The radio
- now sends explicit TxPower to the channel,
- instead of a power level index.
-
-
-== MAC module
-1. TMAC implemented
-
-
-== Application modules
-1. Test throughput app introduced
-
-
-
-Castalia 1.3: Changes from ver 1.2
-------------------------------------------
-- Implementation of 2 routing protocols
-- Implementation of 2 new example applications (using routing protocols)
-- Advanced ability to define various degrees of simpler channel and radio models
-- Bug fixes with the TunableMAC and routing modules
-
-
-
-
-Castalia 1.2: Changes from ver 1.1
-------------------------------------------
-- Creation of a network/routing module.
-- Ability to modify several radio and MAC parameters
- through the application code at run-time.
-- Minor bug fixes relating with EV.
-- Richer debug messages
- (awaiting for the visualization tool)
-
-
-
-Castalia 1.1: Changes from ver 1.0
-------------------------------------------
--Restructuring of the input (omnetpp.ini parameter file)
- to be more modular.
--Restructuring of the output to be clearer.
--Changes to the run scripts to accomodate the above changes.
--Minor bug fixes relating building problems under Cygwin.
+Catalia 3.4: Changes from 3.3
+------------------------------------------
+- Ported to use OMNeT++ 5.4.1. No other functional changes.
+
+
+
+Castalia 3.3: Changes from 3.2
+------------------------------------------
+- Redesigned 802.15.4 MAC module. Modular to allow expansion.
+ Several bug fixes due to the redesign. Now there is a base
+ module to implement the basis of the protocol and then further
+ modules can be developed to take decisions not specified by the
+ protocol. An an example we offer StaticGTS which is a module
+ that assigns statically GTS slots.
+
+- Wireless channel interface created. Base module moved to
+ defaultChannel. SensorNetwork.ned changed accordignly.
+ TraceChannel added
+
+- Castalia script offers new progress output
+ CastaliaResults supports better averaging
+ CastaliaPlot offers new labels to handle legends
+
+- New output by several modules
+ ThroughputTest: Packet success and loss rate, maximum delay
+ Resource manager: Remaining energy, network lifetime, dead nodes
+ Simulation: execution time, sim/exec time ratio
+
+- Bug fixes in BaselineBanMac (pastSyncInterval flag and
+ transmitting when UNCONNECTED). Some output renaming to
+ match 802.15.4 outputs (for easy comparison)
+
+- Bug fixes in TMAC TunableMAC bug fixes regarding decapsulate,
+ and TMAC using own seqNum
+
+
+
+Castalia 3.2: Changes from 3.1
+------------------------------------------
+- Bug fixes:
+ -sleeping bug in 802.15.4 MAC
+ -possible segfault in TimerService code
+ -bugs with DESTROY_NODE and OUT_OF_ENERGY msgs
+ -bug with NODE_STARTUP. Now the Radio and
+ Resource Mgr receive and are affected by
+ the node startup msg
+ -readRSSI was returning -197dBm when no signal
+ was received. Now the noiseFloor is returned
+ -error accumulating in rare cases due to
+ subtract_dBm(). Now this method is not used.
+
+- TunableMAC: changed the beacon TX to not leave
+ gaps. Collect richer output
+
+- Better structured and cleaned the Virtual app/
+ rouring/MAC classes and associated generic packets.
+
+- VirtualApp: empty appID means no filtering of packets
+
+- Added --title and --scale flags to CastaliaPlot,
+ added check for valid gnuplot executable
+
+- Images (png, gif, jpg) produced with CastaliaPlot
+ contain in the header metadata the full command
+ that produced them.
+
+
+Castalia 3.1: Changes from 3.0
+------------------------------------------
+- Introduction of CastaliaPlot to create graphs
+ automatically based on CastaliaResults output
+
+- Features added to CastaliaResults
+ e.g., options --all --sum -v
+
+- Enhanced Tunable MAC with CSMA persistence
+ options, and TX options
+
+- Dublicate packets handled in virtual routing
+ and virtual MAC modules
+
+- Radio module enhanced to handle TXing without
+ interruption
+
+- Minor cleanup and bug fixes:
+ Cleaned up throughput app,
+ bugs in GTS 802.15.4MAC
+ bug in multipathRings
+
+
+
+Castalia 3.0: Major changes from 2.3
+------------------------------------------
+- Porting to OMNeT++ 4.x
+
+- Major restructuring of input and output
+ 1) Standard way to create output and trace files
+ 2) Introduced Castalia script to assist in
+ creating complex simulation scenarios without
+ the need for custom scripting solutions
+ 3) Introduced CastaliaResults script to assist
+ in processing the output easily without the
+ need for custom scripting solutions
+
+- Created virtual classes for app, net, and MAC.
+ New apps or protocols can be easily derived
+ from these classes, which provide considerable
+ abstraction tools and services.
+
+- Independent service of timers to be used with
+ the app routing and MAC modules
+
+- Complete redefinition of Radio module
+ 1) Radio receives signals from the channel.
+ Reception/interference calculations done
+ in radio now (instead of channel)
+ 2) More accurate interference calculation
+ (dynamic intereference accounted not just max)
+ 3) Ability to calculate number of bit errors
+ in a packet (not just 0/1)
+ 4) Multiple RX modes (with different power consumed,
+ datarate, modulation) that can change dynamically
+ 5) Multiple sleep levels.
+ 6) Transition times and power easily defined
+ 7) Multiple carrier frequencies, than ca change dynamically
+ 8) RSSI calculation is modeled more accurately taking
+ into account the history of signals a radio experiences
+
+- Implementation of the Baseline BAN MAC as described
+ in the IEEE 802.15 Task Group 6 proposal.
+
+
+Castalia 2.3: Changes from ver 2.2
+------------------------------------------
+- Implemented GTS mode in 802.15.4 MAC,
+ fixed several bugs.
+- TMAC enhanced to select mechanisms for TA
+ extension and collision resolution
+- Minor modifications in bridgeTestRun script
+ added average energy consumption
+- Batch script for running BAN simulations added
+
+
+Castalia 2.2: Changes from ver 2.1
+------------------------------------------
+- Implementation of 802.15.4 MAC (CAP, beacon mode)
+- added modulation types diffBPSK, diffQPSK
+- throughtputTest application measuring latency
+- throughtputTest app supporting multihop traffic
+ with nextRecipient parameter
+- Bug with TMAC sending many RTS packets fixed
+
+
+
+Castalia 2.1: Changes from ver 2.0
+------------------------------------------
+- T-MAC fully tested and debugged
+- S-MAC implemented as variant of T-MAC
+- Replaced buffer implementations with std
+- parsePRRMap() debugged and complete functionality
+- Automated test suite implemented, look in Tests/
+- 3 more parameters for sensing devices
+
+
+
+Castalia 2.0: Major changes from ver 1.3
+------------------------------------------
+
+== Wireless channel module
+1. Mobility support (!)
+2. Time-varying links (!)
+3. 3D coordinates and orientation
+4. the 2 directions of a link correlated
+ with a dedicated parameter
+
+== Radio Module
+1. Custom modulation allowed by defining
+ a SNR->BER array.
+2. variance in TX power introduced. The radio
+ now sends explicit TxPower to the channel,
+ instead of a power level index.
+
+
+== MAC module
+1. TMAC implemented
+
+
+== Application modules
+1. Test throughput app introduced
+
+
+
+Castalia 1.3: Changes from ver 1.2
+------------------------------------------
+- Implementation of 2 routing protocols
+- Implementation of 2 new example applications (using routing protocols)
+- Advanced ability to define various degrees of simpler channel and radio models
+- Bug fixes with the TunableMAC and routing modules
+
+
+
+
+Castalia 1.2: Changes from ver 1.1
+------------------------------------------
+- Creation of a network/routing module.
+- Ability to modify several radio and MAC parameters
+ through the application code at run-time.
+- Minor bug fixes relating with EV.
+- Richer debug messages
+ (awaiting for the visualization tool)
+
+
+
+Castalia 1.1: Changes from ver 1.0
+------------------------------------------
+-Restructuring of the input (omnetpp.ini parameter file)
+ to be more modular.
+-Restructuring of the output to be clearer.
+-Changes to the run scripts to accomodate the above changes.
+-Minor bug fixes relating building problems under Cygwin.
diff --git a/Castalia/VERSION b/Castalia/VERSION
deleted file mode 100644
index 805eb40a..00000000
--- a/Castalia/VERSION
+++ /dev/null
@@ -1,3 +0,0 @@
-Castalia 3.3
-This version released on 15-05-2013
-[http://castalia.research.nicta.com.au]
diff --git a/Castalia/makemake b/Castalia/makemake
deleted file mode 100755
index 16b3ffe1..00000000
--- a/Castalia/makemake
+++ /dev/null
@@ -1,29 +0,0 @@
-# ****************************************************************************
-# * Copyright: National ICT Australia, 2007 - 2010 *
-# * Developed at the ATP lab, Networked Systems research theme *
-# * Author(s): Athanassios Boulis, Yuriy Tselishchev *
-# * This file is distributed under the terms in the attached LICENSE file. *
-# * If you do not find this file, copies can be found by writing to: *
-# * *
-# * NICTA, Locked Bag 9013, Alexandria, NSW 1435, Australia *
-# * Attention: License Inquiry. *
-# * *
-# ***************************************************************************/
-
-#!/bin/bash
-
-ROOT=`pwd`
-
-# The following options are used by OMNeT's opp_makemake tool
-# For explanation and a complete list of options run: opp_makemake -h
-OPTS=" -f -r --deep -o CastaliaBin -u Cmdenv -P $ROOT -M release"
-
-# -X excludes a directory from being considered
-EXCLUDEDIRS=" -X Simulations -X out -X bin"
-
-# Use options -I -L -l to include external header files or libraries
-EXTOPTS=""
-
-# Run OMNeT's opp_makemake tool with the above options
-opp_makemake $OPTS $EXCLUDEDIRS $EXTOPTS
-
diff --git a/Castalia/LICENSE b/LICENSE
similarity index 100%
rename from Castalia/LICENSE
rename to LICENSE
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..38193010
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+
+.PHONY: all clean cleanall makefiles makefiles-so makefiles-lib makefiles-exe checkmakefiles
+
+all: checkmakefiles
+ @cd src && $(MAKE)
+
+clean: checkmakefiles
+ @cd src && $(MAKE) clean
+
+cleanall: checkmakefiles
+ @cd src && $(MAKE) MODE=release clean
+ @cd src && $(MAKE) MODE=debug clean
+ @rm -f src/Makefile
+
+MAKEMAKE_OPTIONS := -f --deep -o CastaliaBin -O out -I. -DAUTOIMPORT_OMNETPP_NAMESPACE
+
+makefiles: makefiles-exe
+
+makefiles-so:
+ @cd src && opp_makemake --make-so $(MAKEMAKE_OPTIONS)
+
+makefiles-lib:
+ @cd src && opp_makemake --make-lib $(MAKEMAKE_OPTIONS)
+
+makefiles-exe:
+ @cd src && opp_makemake $(MAKEMAKE_OPTIONS)
+
+checkmakefiles:
+ @if [ ! -f src/Makefile ]; then \
+ echo; \
+ echo '========================================================================'; \
+ echo 'src/Makefile does not exist. Please use "make makefiles" to generate it!'; \
+ echo '========================================================================'; \
+ echo; \
+ exit 1; \
+ fi
diff --git a/Castalia/Readme.txt b/Readme.txt
similarity index 85%
rename from Castalia/Readme.txt
rename to Readme.txt
index fc9b5535..9d88d935 100644
--- a/Castalia/Readme.txt
+++ b/Readme.txt
@@ -12,7 +12,7 @@
TO INSTALL Castalia type:
-> ./makemake
+> make makefiles
> make
READ the Instalation guide for more details.
@@ -22,29 +22,29 @@ In the Root directory there are the following contents :
bin --> Dir containing the Castalia and CastaliaResults scripts
-config --> Dir containing the configuration file used by makemake
+doc --> Directory containing installation manual and user guide.
out --> Dir produced by the build process. Contains all interediate
- built files, as well as the Castalia executable.
+ built files, as well as the Castalia executable.
Simulations --> Dir containing various simulation configuration files
- Simulations can easily be run from its sub dirs.
+ Simulations can easily be run from its sub dirs.
src --> The source code of Castalia (*.cc, *.h, *.msg, *.ned files)
The directory's structure corresponds to the structure of the
- compound modules and submodules that Castalia has.
+ compound modules and submodules that Castalia has.
-Makefile --> File created after the invocation of the makemake script.
+src/Makefile --> File created after the invocation of the makemake script.
-makemake --> The script to generate the appropriate Makefiles. It uses
+makemake --> The script to generate the appropriate Makefiles. It uses
OMNeT's opp_makemake tool.
-CastaliaBin --> The Castalia executable. A soft link to out/gcc-debug/CastaliaBin
+src/CastaliaBin --> The Castalia executable. (or CataliaBin_dbg for the debug version)
CHANGES.txt --> The change log.
LICENSE --> The License in plain text
-VERSION --> File with the current version/build info
+VERSION --> File with the current version/build info
=============== READ THE INSTALATION GUIDE AND THE USER'S MANUAL ==============
diff --git a/Castalia/Simulations/BANtest/omnetpp.ini b/Simulations/BANtest/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/BANtest/omnetpp.ini
rename to Simulations/BANtest/omnetpp.ini
diff --git a/Castalia/Simulations/BridgeTest/omnetpp.ini b/Simulations/BridgeTest/omnetpp.ini
similarity index 98%
rename from Castalia/Simulations/BridgeTest/omnetpp.ini
rename to Simulations/BridgeTest/omnetpp.ini
index 6346ed38..8b200f39 100644
--- a/Castalia/Simulations/BridgeTest/omnetpp.ini
+++ b/Simulations/BridgeTest/omnetpp.ini
@@ -29,7 +29,7 @@ SN.node[*].Application.reportDestination = "SINK"
SN.node[*].Communication.RoutingProtocolName = "MultipathRingsRouting"
-[Config 40mBridge]
+[Config _40mBridge]
SN.field_x = 40
SN.field_y = 10
SN.deployment = "[0]->center;[1..6]->3x2"
@@ -40,7 +40,7 @@ SN.physicalProcess[0].point1_y_coord = 5
SN.physicalProcess[0].point2_x_coord = 40
SN.physicalProcess[0].point2_y_coord = 5
-[Config 100mBridge]
+[Config _100mBridge]
SN.field_x = 100
SN.field_y = 20
SN.deployment = "[0]->center;[1..18]->6x3"
@@ -51,7 +51,7 @@ SN.physicalProcess[0].point1_y_coord = 10
SN.physicalProcess[0].point2_x_coord = 100
SN.physicalProcess[0].point2_y_coord = 10
-[Config 200mBridge]
+[Config _200mBridge]
SN.field_x = 200
SN.field_y = 20
SN.deployment = "[0]->center;[1..34]->11x3"
diff --git a/Castalia/Simulations/Parameters/Castalia.ini b/Simulations/Parameters/Castalia.ini
similarity index 98%
rename from Castalia/Simulations/Parameters/Castalia.ini
rename to Simulations/Parameters/Castalia.ini
index 429e27b9..59d03143 100644
--- a/Castalia/Simulations/Parameters/Castalia.ini
+++ b/Simulations/Parameters/Castalia.ini
@@ -18,7 +18,6 @@
# ===========================================================
cmdenv-express-mode = true
-cmdenv-module-messages = true
cmdenv-event-banners = false
cmdenv-performance-display = false
cmdenv-interactive = false
diff --git a/Castalia/Simulations/Parameters/MAC/CSMA.ini b/Simulations/Parameters/MAC/CSMA.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/MAC/CSMA.ini
rename to Simulations/Parameters/MAC/CSMA.ini
diff --git a/Castalia/Simulations/Parameters/MAC/SMAC.ini b/Simulations/Parameters/MAC/SMAC.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/MAC/SMAC.ini
rename to Simulations/Parameters/MAC/SMAC.ini
diff --git a/Castalia/Simulations/Parameters/PhysicalProcess/node0_asssignedValue40.ini b/Simulations/Parameters/PhysicalProcess/node0_asssignedValue40.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/PhysicalProcess/node0_asssignedValue40.ini
rename to Simulations/Parameters/PhysicalProcess/node0_asssignedValue40.ini
diff --git a/Castalia/Simulations/Parameters/PhysicalProcess/node6_asssignedValue40.ini b/Simulations/Parameters/PhysicalProcess/node6_asssignedValue40.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/PhysicalProcess/node6_asssignedValue40.ini
rename to Simulations/Parameters/PhysicalProcess/node6_asssignedValue40.ini
diff --git a/Castalia/Simulations/Parameters/Radio/BANRadio.txt b/Simulations/Parameters/Radio/BANRadio.txt
similarity index 100%
rename from Castalia/Simulations/Parameters/Radio/BANRadio.txt
rename to Simulations/Parameters/Radio/BANRadio.txt
diff --git a/Castalia/Simulations/Parameters/Radio/CC1000.txt b/Simulations/Parameters/Radio/CC1000.txt
similarity index 100%
rename from Castalia/Simulations/Parameters/Radio/CC1000.txt
rename to Simulations/Parameters/Radio/CC1000.txt
diff --git a/Castalia/Simulations/Parameters/Radio/CC2420.txt b/Simulations/Parameters/Radio/CC2420.txt
similarity index 100%
rename from Castalia/Simulations/Parameters/Radio/CC2420.txt
rename to Simulations/Parameters/Radio/CC2420.txt
diff --git a/Castalia/Simulations/Parameters/SensorDevice/Accelerometer.ini b/Simulations/Parameters/SensorDevice/Accelerometer.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/SensorDevice/Accelerometer.ini
rename to Simulations/Parameters/SensorDevice/Accelerometer.ini
diff --git a/Castalia/Simulations/Parameters/WirelessChannel/BANmodels/TemporalModel.txt b/Simulations/Parameters/WirelessChannel/BANmodels/TemporalModel.txt
similarity index 100%
rename from Castalia/Simulations/Parameters/WirelessChannel/BANmodels/TemporalModel.txt
rename to Simulations/Parameters/WirelessChannel/BANmodels/TemporalModel.txt
diff --git a/Castalia/Simulations/Parameters/WirelessChannel/BANmodels/pathLossMap.txt b/Simulations/Parameters/WirelessChannel/BANmodels/pathLossMap.txt
similarity index 100%
rename from Castalia/Simulations/Parameters/WirelessChannel/BANmodels/pathLossMap.txt
rename to Simulations/Parameters/WirelessChannel/BANmodels/pathLossMap.txt
diff --git a/Castalia/Simulations/Parameters/WirelessChannel/Ideal.ini b/Simulations/Parameters/WirelessChannel/Ideal.ini
similarity index 100%
rename from Castalia/Simulations/Parameters/WirelessChannel/Ideal.ini
rename to Simulations/Parameters/WirelessChannel/Ideal.ini
diff --git a/Castalia/Simulations/connectivityMap/omnetpp.ini b/Simulations/connectivityMap/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/connectivityMap/omnetpp.ini
rename to Simulations/connectivityMap/omnetpp.ini
diff --git a/Castalia/Simulations/radioTest/omnetpp.ini b/Simulations/radioTest/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/radioTest/omnetpp.ini
rename to Simulations/radioTest/omnetpp.ini
diff --git a/Castalia/Simulations/simpleAggregation/omnetpp.ini b/Simulations/simpleAggregation/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/simpleAggregation/omnetpp.ini
rename to Simulations/simpleAggregation/omnetpp.ini
diff --git a/Castalia/Simulations/valuePropagation/omnetpp.ini b/Simulations/valuePropagation/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/valuePropagation/omnetpp.ini
rename to Simulations/valuePropagation/omnetpp.ini
diff --git a/Castalia/Simulations/valueReporting/omnetpp.ini b/Simulations/valueReporting/omnetpp.ini
similarity index 100%
rename from Castalia/Simulations/valueReporting/omnetpp.ini
rename to Simulations/valueReporting/omnetpp.ini
diff --git a/VERSION b/VERSION
new file mode 100644
index 00000000..3d75d156
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,3 @@
+Castalia 3.4
+This version released on 25-04-2019
+[https://github.com/boulis/Castalia]
diff --git a/Castalia/bin/Castalia b/bin/Castalia
similarity index 78%
rename from Castalia/bin/Castalia
rename to bin/Castalia
index a99f1c1c..5882bc12 100755
--- a/Castalia/bin/Castalia
+++ b/bin/Castalia
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
# ****************************************************************************
# * Copyright: National ICT Australia, 2009 - 2010 *
# * Developed at the ATP lab, Networked Systems research theme *
@@ -17,18 +17,22 @@ from optparse import OptionParser
#initialise important paths
pathToBin = sys.path[0]
-pathToCastalia = os.path.abspath(pathToBin + "/../")
+pathToCastalia = os.path.abspath(pathToBin + "/../src")
pathToCastaliaBin = pathToCastalia + "/CastaliaBin";
-pathToExtract = pathToBin + "/extractOmnetppINI"
+pathToCastaliaBinExe = pathToCastaliaBin + ".exe";
+pathToExtract = "python2 "+pathToBin + "/extractOmnetppINI"
if len(sys.argv) == 1:
has_header = 0
for file in os.listdir('./'):
if not os.path.isfile(file): continue
if not re.search(r"\.ini$",file): continue
- lines = commands.getoutput(pathToExtract + " " + file).split("\n")
+ print (pathToExtract)
+ #lines = commands.getoutput(pathToExtract + " " + file).split("\n")
+ lines = subprocess.check_output(pathToExtract + " " + file, shell=True).split("\n")
if len(lines) < 2: continue
has_general = 0;
+ print ("\n File \n"+ file + " Lines ")
list = []
for line in lines:
m = re.match(r"\[General\]", line)
@@ -41,12 +45,12 @@ if len(sys.argv) == 1:
if has_general:
if not has_header:
has_header = 1
- print "\nList of available input files and configurations:"
- print "\n* "+file
- print "\t"+"\n\t".join(list)
+ print ("\nList of available input files and configurations:")
+ print ("\n* "+file)
+ print ("\t"+"\n\t".join(list))
if not has_header:
- print "\nNo castalia input files found in this directory\n"
- else: print ""
+ print ("\nNo castalia input files found in this directory\n")
+ else: print ("")
quit()
parser = OptionParser(usage="usage: %prog [options]")
@@ -55,6 +59,7 @@ parser.add_option("-i","--input", dest="input", type="string", default="omnetpp.
parser.add_option("-d","--debug", dest="debug", default=False, action="store_true", help="Debug mode, will display results from each CastaliaBin execution")
parser.add_option("-o","--output", dest="output", type="string", metavar="FILE", help="Select output file for writing results, generated from current date by default")
parser.add_option("-r","--repeat", dest="repeat", type="int", metavar="N", default=1, help="Number of repetitions for each unique scenario")
+parser.add_option("-u","--userinterface", dest="interface", type="string", default="Cmdenv", help="Select the interface type, values Cmdenv, Qtenv and Tkenv, default Cmdenv")
(options,args) = parser.parse_args()
if len(args):
@@ -126,16 +131,27 @@ def detectCPUs():
return ncpus
return 1 # Default
-ini = commands.getoutput(pathToExtract + " " + options.input).split("\n")
+ini = subprocess.check_output(pathToExtract + " " + options.input, shell=True).split("\n")
+#ini = commands.getoutput(pathToExtract + " " + options.input).split("\n")
if len(ini) < 2: quit("\nERROR: Unable to read configuration")
+
+isExec = 0
if not os.path.exists(pathToCastaliaBin) or not os.path.isfile(pathToCastaliaBin):
- quit("\nERROR: CastaliaBin not found (need to run make?)")
+ if not os.path.exists(pathToCastaliaBinExe) or not os.path.isfile(pathToCastaliaBinExe): # check exect
+ quit("\nERROR: CastaliaBin not found (need to run make?)")
+ else:
+ isExec = 1
section = ""
configDictionary = {}
configIterations = {}
+ind = 0
+
for line in ini:
+ ind = ind+1
+ if "\r" in line:
+ line = line[:-1]
if (line == "[General]"):
section = "General"
continue
@@ -146,9 +162,13 @@ for line in ini:
continue
k = re.split("\s=\s",line,1)
+ if (len(k) != 2 and len(ini) == ind):
+ continue
if (len(k) != 2):
+ print ("Line " + str(ind))
quit("\nERROR: Unexpected line in configuration file:\n" + line)
+
currentConfig = {}
if (configDictionary.has_key(section)):
currentConfig = configDictionary[section]
@@ -291,13 +311,23 @@ if options.output: fr = open(options.output,"w")
else: fr = open(datetime.now().strftime("%y%m%d-%H%M%S")+".txt","w")
fr.write("Castalia| what:" + options.config + " (" + str(options.repeat) + ")\n")
fr.write("Castalia| when:" + datetime.now().strftime("%Y-%m-%d %H:%M") + "\n")
+if(options.config == "General"):
+ fr.write("Castalia| label:General\n") # If missing
-r_castalia = re.compile("^Castalia\|\s+(.+)$")
+r_castalia = re.compile('^((?!Castalia\|).)*$') #re.compile("^Castalia\|\s+(.+)$")
r_scenario = re.compile("Scenario:\s(.*)\$repetition=(\d+)$")
-r_progress = re.compile("^\*\* Event \#\d+\s+T=(\S+)\s+Elapsed: (\S+)s.+\s(\d+)\% completed")
+r_progress = re.compile("^\*\* Event \#\d+\s+t=(\S+)\s+Elapsed: (\S+)s.+\s(\d+)\% completed") #re.compile("^\*\* Event \#\d+\s+T=(\S+)\s+Elapsed: (\S+)s.+\s(\d+)\% completed")
r_newrun = re.compile("Preparing for running configuration General, run #(\d+)")
r_totalrun = re.compile("Number of runs: (\d+)")
+
+interface = "Cmdenv"
+if options.interface:
+ if options.interface == "Qtenv":
+ interface = "Qtenv"
+ elif options.interface == "Tkenv":
+ interface = "Tkenv"
+
for ini in iniList:
ini_num += 1
baselabel = label = labelList.pop(0)
@@ -308,34 +338,44 @@ for ini in iniList:
f.write(k + " = " + ini[k] + "\n")
f.close();
has_output = 0
+
if sys.version_info > (2,7):
- data = subprocess.check_output([pathToCastaliaBin, '-f', 'omnetpp.tmp', '-x', 'General']).split("\n")
+ if not isExec:
+ data = subprocess.check_output([pathToCastaliaBin,'-f', 'omnetpp.tmp', '-c', 'General','-q', 'runs']).split("\n")
+ else:
+ data = subprocess.check_output([pathToCastaliaBinExe, '-f','omnetpp.tmp', '-c', 'General','-q', 'runs']).split("\n")
else:
- data = subprocess.Popen([pathToCastaliaBin, '-f', 'omnetpp.tmp', '-x', 'General'], stdout=subprocess.PIPE).communicate()[0].split("\n")
+ if not isExec:
+ data = subprocess.Popen([pathToCastaliaBin,'-f', 'omnetpp.tmp','-c', 'General','-q', 'runs'], stdout=subprocess.PIPE).communicate()[0].split("\n")
+ else:
+ data = subprocess.Popen([pathToCastaliaBinExe,'-f', 'omnetpp.tmp','-c', 'General','-q', 'runs'], stdout=subprocess.PIPE).communicate()[0].split("\n")
- if len(data) > 6: data = data[6]
+ if len(data) > 7: data = data[7]
else: data = ""
m = r_totalrun.match(data)
if (m):
runs = "/" + m.group(1)
else:
- print "WARNING: unable to determine total simulation runs"
+ print ("WARNING: unable to determine total simulation runs")
runs = ""
-
- CastaliaProcess = subprocess.Popen([pathToCastaliaBin, '-f', 'omnetpp.tmp'], stdout = subprocess.PIPE)
+ if not isExec:
+ CastaliaProcess = subprocess.Popen([pathToCastaliaBin,'-u', interface, '-f', 'omnetpp.tmp'], stdout = subprocess.PIPE)
+ else:
+ CastaliaProcess = subprocess.Popen([pathToCastaliaBinExe,'-u', interface, '-f', 'omnetpp.tmp'], stdout = subprocess.PIPE)
raw_output = []
+
while 1:
line = CastaliaProcess.stdout.readline()
if not line: break
m = r_castalia.match(line)
- if (m): #this is an output line, starting with 'Castalia |' prefix
- fr.write(line)
+ if (not m): #this is an output line, starting with 'Castalia |' prefix
+ fr.write(line[7:])
has_output = 1
continue
- if options.debug: print line,
+ if options.debug: print (line),
m = r_progress.match(line)
if (m): #this is simulation progress line
@@ -343,13 +383,13 @@ for ini in iniList:
elapsed = float(m.group(2))
percent = int(m.group(3))
if not options.debug:
- print "\rRunning Castalia:\tConfiguration", str(ini_num) + "/" + str(len(iniList)),
- print "\tRun", str(run) + runs,
- print "\tComplete", str(percent) + "%",
+ print ("\rRunning Castalia:\tConfiguration", str(ini_num) + "/" + str(len(iniList))),
+ print ("\tRun", str(run) + runs),
+ print ("\tComplete", str(percent) + "%"),
if percent == 100: #end of this run, record execution time in the results file
if not options.debug:
- print "\tTime taken", str(timedelta(0,elapsed))
+ print ("\tTime taken", str(timedelta(0,elapsed)))
fr.write("Castalia| module:SN.Simulation\n")
fr.write("Castalia| simple output name:Execution time, seconds\n")
fr.write("Castalia| " + str(elapsed) + "\n")
@@ -381,7 +421,7 @@ for ini in iniList:
if not has_output:
fr.write("\n".join(raw_output))
- print "\n".join(raw_output)
+ print ("\n".join(raw_output))
if not options.debug: commands.getoutput("rm omnetpp.tmp")
fr.close()
diff --git a/Castalia/bin/CastaliaPlot b/bin/CastaliaPlot
similarity index 100%
rename from Castalia/bin/CastaliaPlot
rename to bin/CastaliaPlot
diff --git a/Castalia/bin/CastaliaResults b/bin/CastaliaResults
similarity index 100%
rename from Castalia/bin/CastaliaResults
rename to bin/CastaliaResults
diff --git a/Castalia/bin/extractOmnetppINI b/bin/extractOmnetppINI
similarity index 100%
rename from Castalia/bin/extractOmnetppINI
rename to bin/extractOmnetppINI
diff --git a/Castalia - Installation.docx b/doc/Castalia - Installation.docx
similarity index 100%
rename from Castalia - Installation.docx
rename to doc/Castalia - Installation.docx
diff --git a/Castalia - User Manual.docx b/doc/Castalia - User Manual.docx
similarity index 100%
rename from Castalia - User Manual.docx
rename to doc/Castalia - User Manual.docx
diff --git a/makemake b/makemake
new file mode 100755
index 00000000..60d29327
--- /dev/null
+++ b/makemake
@@ -0,0 +1,2 @@
+#! /bin/sh
+make makefiles
\ No newline at end of file
diff --git a/Castalia/src/CastaliaMessages.h b/src/CastaliaMessages.h
similarity index 100%
rename from Castalia/src/CastaliaMessages.h
rename to src/CastaliaMessages.h
diff --git a/Castalia/src/SensorNetwork.ned b/src/SensorNetwork.ned
similarity index 90%
rename from Castalia/src/SensorNetwork.ned
rename to src/SensorNetwork.ned
index cafaf8ce..b53b1715 100644
--- a/Castalia/src/SensorNetwork.ned
+++ b/src/SensorNetwork.ned
@@ -17,9 +17,9 @@ import node;
network SN {
parameters:
- int field_x = default (30); // the length of the deployment field
- int field_y = default (30); // the width of the deployment field
- int field_z = default (0); // the height of the deployment field (2-D field by default)
+ double field_x = default (30); // the length of the deployment field
+ double field_y = default (30); // the width of the deployment field
+ double field_z = default (0); // the height of the deployment field (2-D field by default)
int numNodes; // the number of nodes
diff --git a/Castalia/src/helpStructures/CastaliaModule.cc b/src/helpStructures/CastaliaModule.cc
similarity index 91%
rename from Castalia/src/helpStructures/CastaliaModule.cc
rename to src/helpStructures/CastaliaModule.cc
index 3392f013..758f9bd3 100644
--- a/Castalia/src/helpStructures/CastaliaModule.cc
+++ b/src/helpStructures/CastaliaModule.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "CastaliaModule.h"
+#include "helpStructures/CastaliaModule.h"
#define CASTALIA_PREFIX "Castalia|\t"
@@ -98,7 +98,7 @@ void CastaliaModule::declareOutput(const char *descr)
void CastaliaModule::collectOutput(const char *descr, int index)
{
if (index < 0)
- opp_error("Negative output index not permitted");
+ throw cRuntimeError("Negative output index not permitted");
collectOutputNocheck(descr, index, "", 1);
}
@@ -106,7 +106,7 @@ void CastaliaModule::collectOutput(const char *descr, int index,
const char *label, double amt)
{
if (index < 0)
- opp_error("Negative output index not permitted");
+ throw cRuntimeError("Negative output index not permitted");
collectOutputNocheck(descr, index, label, amt);
}
@@ -122,7 +122,7 @@ void CastaliaModule::collectOutputNocheck(const char *descr, int index,
void CastaliaModule::collectOutput(const char *descr, int index, const char *label)
{
if (index < 0)
- opp_error("Negative output index not permitted");
+ throw cRuntimeError("Negative output index not permitted");
collectOutputNocheck(descr, index, label, 1);
}
@@ -130,7 +130,7 @@ void CastaliaModule::declareHistogram(const char *descr, double min,
double max, int buckets)
{
if (min >= max || buckets < 1)
- opp_error("ERROR: declareHistogram failed, bad parameters");
+ throw cRuntimeError("ERROR: declareHistogram failed, bad parameters");
histogramOutputByIndex hist;
hist.min = min;
@@ -144,7 +144,7 @@ void CastaliaModule::declareHistogram(const char *descr, double min,
void CastaliaModule::collectHistogram(const char *descr, int index, double value)
{
if (index < 0)
- opp_error("Negative output index not permitted");
+ throw cRuntimeError("Negative output index not permitted");
collectHistogramNocheck(descr, index, value);
}
@@ -181,9 +181,9 @@ void CastaliaModule::powerDrawn(double power)
else if (name.compare("SensorManager") == 0)
classPointers.resourceManager = getParentModule()->getSubmodule("ResourceManager");
else
- opp_error("%s module has no rights to call drawPower() function", getFullPath().c_str());
+ throw cRuntimeError("%s module has no rights to call drawPower() function", getFullPath().c_str());
if (!classPointers.resourceManager)
- opp_error("Unable to find pointer to resource manager module");
+ throw cRuntimeError("Unable to find pointer to resource manager module");
}
ResourceManagerMessage *drawPowerMsg =
diff --git a/Castalia/src/helpStructures/CastaliaModule.h b/src/helpStructures/CastaliaModule.h
similarity index 96%
rename from Castalia/src/helpStructures/CastaliaModule.h
rename to src/helpStructures/CastaliaModule.h
index 79f55fdd..d54e3fc6 100644
--- a/Castalia/src/helpStructures/CastaliaModule.h
+++ b/src/helpStructures/CastaliaModule.h
@@ -19,9 +19,9 @@
#include
#include
-#include "DebugInfoWriter.h"
+#include "helpStructures/DebugInfoWriter.h"
#include "CastaliaMessages.h"
-#include "ResourceManagerMessage_m.h"
+#include "node/resourceManager/ResourceManagerMessage_m.h"
using namespace std;
diff --git a/Castalia/src/helpStructures/DebugInfoWriter.cc b/src/helpStructures/DebugInfoWriter.cc
similarity index 96%
rename from Castalia/src/helpStructures/DebugInfoWriter.cc
rename to src/helpStructures/DebugInfoWriter.cc
index fb9a7e32..4e31b59b 100644
--- a/Castalia/src/helpStructures/DebugInfoWriter.cc
+++ b/src/helpStructures/DebugInfoWriter.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "DebugInfoWriter.h"
+#include "helpStructures/DebugInfoWriter.h"
ofstream DebugInfoWriter::theFile;
string DebugInfoWriter::fileName;
diff --git a/Castalia/src/helpStructures/DebugInfoWriter.h b/src/helpStructures/DebugInfoWriter.h
similarity index 100%
rename from Castalia/src/helpStructures/DebugInfoWriter.h
rename to src/helpStructures/DebugInfoWriter.h
diff --git a/Castalia/src/helpStructures/TimerService.cc b/src/helpStructures/TimerService.cc
similarity index 83%
rename from Castalia/src/helpStructures/TimerService.cc
rename to src/helpStructures/TimerService.cc
index 3fce82b8..412a4014 100644
--- a/Castalia/src/helpStructures/TimerService.cc
+++ b/src/helpStructures/TimerService.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "TimerService.h"
+#include "helpStructures/TimerService.h"
void TimerService::setTimerDrift(double new_drift)
{
@@ -24,9 +24,9 @@ void TimerService::timerFiredCallback(int timerIndex)
void TimerService::cancelTimer(int timerIndex)
{
if (timerIndex < 0)
- opp_error("cancelTimer(): timerIndex=%i negative index is not allowed",timerIndex);
+ throw cRuntimeError("cancelTimer(): timerIndex=%i negative index is not allowed",timerIndex);
if (timerIndex >= TIMER_MAX_SIZE)
- opp_error("cancelTimer(): timerIndex=%i is too large",timerIndex);
+ throw cRuntimeError("cancelTimer(): timerIndex=%i is too large",timerIndex);
if (timerIndex >= timerMessages.size())
return;
TimerServiceMessage* tmp = timerMessages[timerIndex];
@@ -38,9 +38,9 @@ void TimerService::cancelTimer(int timerIndex)
void TimerService::setTimer(int timerIndex, simtime_t time)
{
if (timerIndex < 0)
- opp_error("setTimer(): timerIndex=%i negative index is not allowed",timerIndex);
+ throw cRuntimeError("setTimer(): timerIndex=%i negative index is not allowed",timerIndex);
if (timerIndex >= TIMER_MAX_SIZE)
- opp_error("setTimer(): timerIndex=%i is too large",timerIndex);
+ throw cRuntimeError("setTimer(): timerIndex=%i is too large",timerIndex);
cancelTimer(timerIndex);
if (timerIndex >= timerMessages.size()) {
int newSize = timerMessages.size() + TIMER_MIN_SIZE;
@@ -73,9 +73,9 @@ void TimerService::handleTimerMessage(cMessage * msg)
simtime_t TimerService::getTimer(int timerIndex)
{
if (timerIndex < 0)
- opp_error("getTimer(): timerIndex=%i negative index is not allowed",timerIndex);
+ throw cRuntimeError("getTimer(): timerIndex=%i negative index is not allowed",timerIndex);
if (timerIndex >= TIMER_MAX_SIZE)
- opp_error("getTimer(): timerIndex=%i is too large",timerIndex);
+ throw cRuntimeError("getTimer(): timerIndex=%i is too large",timerIndex);
if (timerIndex >= timerMessages.size())
return -1;
if (timerMessages[timerIndex] == NULL)
diff --git a/Castalia/src/helpStructures/TimerService.h b/src/helpStructures/TimerService.h
similarity index 96%
rename from Castalia/src/helpStructures/TimerService.h
rename to src/helpStructures/TimerService.h
index 7babb44c..c5215ba7 100644
--- a/Castalia/src/helpStructures/TimerService.h
+++ b/src/helpStructures/TimerService.h
@@ -20,7 +20,7 @@
#include
#include "CastaliaMessages.h"
-#include "TimerServiceMessage_m.h"
+#include "helpStructures/TimerServiceMessage_m.h"
class TimerService: public virtual cSimpleModule {
private:
diff --git a/Castalia/src/helpStructures/TimerServiceMessage.msg b/src/helpStructures/TimerServiceMessage.msg
similarity index 100%
rename from Castalia/src/helpStructures/TimerServiceMessage.msg
rename to src/helpStructures/TimerServiceMessage.msg
diff --git a/src/makefrag b/src/makefrag
new file mode 100644
index 00000000..47eaa094
--- /dev/null
+++ b/src/makefrag
@@ -0,0 +1,4 @@
+#
+# Use the older message compiler. New compiler was introduced in OMNeT++ 5.3
+#
+MSGC:=$(MSGC) --msg4
\ No newline at end of file
diff --git a/Castalia/src/node/Node.ned b/src/node/Node.ned
similarity index 100%
rename from Castalia/src/node/Node.ned
rename to src/node/Node.ned
diff --git a/Castalia/src/node/application/ApplicationPacket.msg b/src/node/application/ApplicationPacket.msg
similarity index 100%
rename from Castalia/src/node/application/ApplicationPacket.msg
rename to src/node/application/ApplicationPacket.msg
diff --git a/Castalia/src/node/application/VirtualApplication.cc b/src/node/application/VirtualApplication.cc
similarity index 93%
rename from Castalia/src/node/application/VirtualApplication.cc
rename to src/node/application/VirtualApplication.cc
index 7f8ef4f2..894e5bcb 100644
--- a/Castalia/src/node/application/VirtualApplication.cc
+++ b/src/node/application/VirtualApplication.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "VirtualApplication.h"
+#include "node/application/VirtualApplication.h"
void VirtualApplication::initialize()
{
@@ -24,7 +24,7 @@ void VirtualApplication::initialize()
radioModule = check_and_cast (parent->getSubmodule("Communication")->getSubmodule("Radio"));
// check that all the pointers are valid
if (!resMgrModule || !mobilityModule || !radioModule)
- opp_error("\n Virtual App init: Error in geting a valid reference module(s).");
+ throw cRuntimeError("\n Virtual App init: Error in geting a valid reference module(s).");
self = parent->getIndex();
// create the routing level address using self
@@ -42,7 +42,7 @@ void VirtualApplication::initialize()
double startup_delay = parent->par("startupOffset");
// Randomize the delay if the startupRandomization is non-zero
- startup_delay += genk_dblrand(0) * (double)parent->par("startupRandomization");
+ startup_delay += getRNG(0)->doubleRand() * (double)parent->par("startupRandomization");
/* Send the STARTUP message to 1)Sensor_Manager, 2)Commmunication module,
* 3) Resource Manager, and $)APP (self message) so that the node starts
@@ -61,7 +61,7 @@ void VirtualApplication::initialize()
* following two parameters. If they are not defined then the
* declareHistogram and collectHistogram statement are not called.
*/
- latencyMax = hasPar("latencyHistogramMax") ? par("latencyHistogramMax") : 0;
+ latencyMax = hasPar("latencyHistogramMax") ? par("latencyHistogramMax") : 0.0;
latencyBuckets = hasPar("latencyHistogramBuckets") ? par("latencyHistogramBuckets") : 0;
if (latencyMax > 0 && latencyBuckets > 0)
declareHistogram("Application level latency, in ms", 0, latencyMax, latencyBuckets);
@@ -146,7 +146,7 @@ void VirtualApplication::handleMessage(cMessage * msg)
default:
{
- opp_error("Application module received unexpected message");
+ throw cRuntimeError("Application module received unexpected message");
}
}
@@ -185,7 +185,7 @@ void VirtualApplication::requestSensorReading(int index)
void VirtualApplication::toNetworkLayer(cMessage * msg)
{
if (msg->getKind() == APPLICATION_PACKET)
- opp_error("toNetworkLayer() function used incorrectly to send APPLICATION_PACKET without destination Network address");
+ throw cRuntimeError("toNetworkLayer() function used incorrectly to send APPLICATION_PACKET without destination Network address");
send(msg, "toCommunicationModule");
}
diff --git a/Castalia/src/node/application/VirtualApplication.h b/src/node/application/VirtualApplication.h
similarity index 87%
rename from Castalia/src/node/application/VirtualApplication.h
rename to src/node/application/VirtualApplication.h
index e03f5b3f..86bd9d1c 100644
--- a/Castalia/src/node/application/VirtualApplication.h
+++ b/src/node/application/VirtualApplication.h
@@ -17,13 +17,13 @@
#include
#include
#include
-#include "ApplicationPacket_m.h"
-#include "SensorManagerMessage_m.h"
-#include "ResourceManager.h"
-#include "Radio.h"
-#include "VirtualMobilityManager.h"
-#include "CastaliaModule.h"
-#include "TimerService.h"
+#include "node/application/ApplicationPacket_m.h"
+#include "node/sensorManager/SensorManagerMessage_m.h"
+#include "node/resourceManager/ResourceManager.h"
+#include "node/communication/radio/Radio.h"
+#include "node/mobilityManager/VirtualMobilityManager.h"
+#include "helpStructures/CastaliaModule.h"
+#include "helpStructures/TimerService.h"
#define SELF_NETWORK_ADDRESS selfAddress.c_str()
diff --git a/Castalia/src/node/application/bridgeTest/BridgeTest.cc b/src/node/application/bridgeTest/BridgeTest.cc
similarity index 99%
rename from Castalia/src/node/application/bridgeTest/BridgeTest.cc
rename to src/node/application/bridgeTest/BridgeTest.cc
index 5cfad92b..8b9da91d 100644
--- a/Castalia/src/node/application/bridgeTest/BridgeTest.cc
+++ b/src/node/application/bridgeTest/BridgeTest.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "BridgeTest.h"
+#include "node/application/bridgeTest/BridgeTest.h"
Define_Module(BridgeTest);
diff --git a/Castalia/src/node/application/bridgeTest/BridgeTest.h b/src/node/application/bridgeTest/BridgeTest.h
similarity index 96%
rename from Castalia/src/node/application/bridgeTest/BridgeTest.h
rename to src/node/application/bridgeTest/BridgeTest.h
index 5d2e4bf1..edf1c433 100644
--- a/Castalia/src/node/application/bridgeTest/BridgeTest.h
+++ b/src/node/application/bridgeTest/BridgeTest.h
@@ -13,7 +13,7 @@
#ifndef _BridgeTest_H_
#define _BridgeTest_H_
-#include "VirtualApplication.h"
+#include "node/application/VirtualApplication.h"
#define REPROGRAM_PACKET_NAME "Bridge test reprogram packet"
#define REPORT_PACKET_NAME "Bridge test report packet"
@@ -40,7 +40,7 @@ enum BridgeTestTimers {
class BridgeTest:public VirtualApplication {
private:
- int reportTreshold;
+ double reportTreshold;
double sampleInterval;
simtime_t reprogramInterval;
simtime_t reprogramPacketDelay;
diff --git a/Castalia/src/node/application/bridgeTest/BridgeTest.ned b/src/node/application/bridgeTest/BridgeTest.ned
similarity index 94%
rename from Castalia/src/node/application/bridgeTest/BridgeTest.ned
rename to src/node/application/bridgeTest/BridgeTest.ned
index 8c3a671d..300a99f6 100644
--- a/Castalia/src/node/application/bridgeTest/BridgeTest.ned
+++ b/src/node/application/bridgeTest/BridgeTest.ned
@@ -32,8 +32,8 @@ simple BridgeTest like node.application.iApplication {
double reportTreshold = default (10);
double sampleInterval = default (100); // in ms
int sampleSize = default (12); // in bytes
- int reprogramInterval = default (86400); // in seconds
- int reprogramPacketDelay = default (500); // in ms
+ double reprogramInterval = default (86400); // in seconds
+ double reprogramPacketDelay = default (500); // in ms
int reprogramPayload = default (5120); // in bytes
int maxPayloadPacketSize = default (128); // in bytes
diff --git a/Castalia/src/node/application/connectivityMap/ConnectivityMap.cc b/src/node/application/connectivityMap/ConnectivityMap.cc
similarity index 90%
rename from Castalia/src/node/application/connectivityMap/ConnectivityMap.cc
rename to src/node/application/connectivityMap/ConnectivityMap.cc
index 2fefca0b..708c1903 100644
--- a/Castalia/src/node/application/connectivityMap/ConnectivityMap.cc
+++ b/src/node/application/connectivityMap/ConnectivityMap.cc
@@ -10,7 +10,7 @@
* *
*******************************************************************************/
-#include "ConnectivityMap.h"
+#include "node/application/connectivityMap/ConnectivityMap.h"
Define_Module(ConnectivityMap);
@@ -27,9 +27,9 @@ void ConnectivityMap::startup()
txInterval_perNode = packetsPerNode * packetSpacing;
txInterval_total = (txInterval_perNode * totalSNnodes);
- if (strtod(ev.getConfig()->getConfigValue("sim-time-limit"), NULL) < txInterval_total) {
+ if (strtod(cSimulation::getActiveEnvir()->getConfig()->getConfigValue("sim-time-limit"), NULL) < txInterval_total) {
trace() << "ERROR: Total sim time should be at least = " << txInterval_total;
- opp_error("\nError: simulation time not large enough for the conectivity map application\n");
+ throw cRuntimeError("\nError: simulation time not large enough for the conectivity map application\n");
}
double startTxTime = txInterval_perNode * self;
diff --git a/Castalia/src/node/application/connectivityMap/ConnectivityMap.h b/src/node/application/connectivityMap/ConnectivityMap.h
similarity index 92%
rename from Castalia/src/node/application/connectivityMap/ConnectivityMap.h
rename to src/node/application/connectivityMap/ConnectivityMap.h
index 0acfcf49..5bae35f3 100644
--- a/Castalia/src/node/application/connectivityMap/ConnectivityMap.h
+++ b/src/node/application/connectivityMap/ConnectivityMap.h
@@ -13,7 +13,7 @@
#ifndef _CONNECTIVITYMAP_H_
#define _CONNECTIVITYMAP_H_
-#include "VirtualApplication.h"
+#include "node/application/VirtualApplication.h"
using namespace std;
@@ -30,17 +30,12 @@ enum ConnectivityMapTimers {
class ConnectivityMap: public VirtualApplication {
private:
// parameters and variables
- int priority;
- int packetHeaderOverhead;
- bool printConnMap;
- int constantDataPayload;
double packetSpacing;
int packetsPerNode;
int packetSize;
vector neighborTable;
int packetsSent;
- int serialNumber;
int totalSNnodes;
double txInterval_perNode;
double txInterval_total;
diff --git a/Castalia/src/node/application/connectivityMap/ConnectivityMap.ned b/src/node/application/connectivityMap/ConnectivityMap.ned
similarity index 97%
rename from Castalia/src/node/application/connectivityMap/ConnectivityMap.ned
rename to src/node/application/connectivityMap/ConnectivityMap.ned
index 9cd6ac53..6edd4f22 100644
--- a/Castalia/src/node/application/connectivityMap/ConnectivityMap.ned
+++ b/src/node/application/connectivityMap/ConnectivityMap.ned
@@ -23,7 +23,7 @@ simple ConnectivityMap like node.application.iApplication {
int priority = default (1);
int constantDataPayload = default (8);
- int packetSpacing = default (100); // in ms
+ double packetSpacing = default (100); // in ms
int packetsPerNode = default (100);
int packetSize = default (32); // in bytes
diff --git a/Castalia/src/node/application/iApplication.ned b/src/node/application/iApplication.ned
similarity index 100%
rename from Castalia/src/node/application/iApplication.ned
rename to src/node/application/iApplication.ned
diff --git a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.cc b/src/node/application/simpleAggregation/SimpleAggregation.cc
similarity index 97%
rename from Castalia/src/node/application/simpleAggregation/SimpleAggregation.cc
rename to src/node/application/simpleAggregation/SimpleAggregation.cc
index 3910bb5f..ad58d062 100644
--- a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.cc
+++ b/src/node/application/simpleAggregation/SimpleAggregation.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "SimpleAggregation.h"
+#include "node/application/simpleAggregation/SimpleAggregation.h"
Define_Module(SimpleAggregation);
diff --git a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.h b/src/node/application/simpleAggregation/SimpleAggregation.h
similarity index 96%
rename from Castalia/src/node/application/simpleAggregation/SimpleAggregation.h
rename to src/node/application/simpleAggregation/SimpleAggregation.h
index 3b6d2f51..a35b925b 100644
--- a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.h
+++ b/src/node/application/simpleAggregation/SimpleAggregation.h
@@ -13,7 +13,7 @@
#ifndef _SIMPLEAGGREGATION_H_
#define _SIMPLEAGGREGATION_H_
-#include "VirtualApplication.h"
+#include "node/application/VirtualApplication.h"
using namespace std;
@@ -25,7 +25,6 @@ enum SimpleAggregationTimers {
class SimpleAggregation: public VirtualApplication {
private:
double aggregatedValue;
- int routingLevel;
double waitingTimeForLowerLevelData;
double lastSensedValue;
double sampleInterval;
diff --git a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.ned b/src/node/application/simpleAggregation/SimpleAggregation.ned
similarity index 96%
rename from Castalia/src/node/application/simpleAggregation/SimpleAggregation.ned
rename to src/node/application/simpleAggregation/SimpleAggregation.ned
index ea9c379e..e0fd021f 100644
--- a/Castalia/src/node/application/simpleAggregation/SimpleAggregation.ned
+++ b/src/node/application/simpleAggregation/SimpleAggregation.ned
@@ -22,7 +22,7 @@ simple SimpleAggregation like node.application.iApplication {
int priority = default (1);
int packetHeaderOverhead = default (8); // in bytes
int constantDataPayload = default (2); // in bytes
- int sampleInterval = default (1000); // in ms
+ double sampleInterval = default (1000); // in ms
bool isSink = default (false);
gates:
diff --git a/Castalia/src/node/application/throughputTest/ThroughputTest.cc b/src/node/application/throughputTest/ThroughputTest.cc
similarity index 98%
rename from Castalia/src/node/application/throughputTest/ThroughputTest.cc
rename to src/node/application/throughputTest/ThroughputTest.cc
index 00823b95..5b232b36 100644
--- a/Castalia/src/node/application/throughputTest/ThroughputTest.cc
+++ b/src/node/application/throughputTest/ThroughputTest.cc
@@ -10,7 +10,7 @@
* *
****************************************************************************/
-#include "ThroughputTest.h"
+#include "node/application/throughputTest/ThroughputTest.h"
Define_Module(ThroughputTest);
diff --git a/Castalia/src/node/application/throughputTest/ThroughputTest.h b/src/node/application/throughputTest/ThroughputTest.h
similarity index 97%
rename from Castalia/src/node/application/throughputTest/ThroughputTest.h
rename to src/node/application/throughputTest/ThroughputTest.h
index 4aef0af9..9800d7c4 100644
--- a/Castalia/src/node/application/throughputTest/ThroughputTest.h
+++ b/src/node/application/throughputTest/ThroughputTest.h
@@ -13,7 +13,7 @@
#ifndef _THROUGHPUTTEST_H_
#define _THROUGHPUTTEST_H_
-#include "VirtualApplication.h"
+#include "node/application/VirtualApplication.h"
#include