Skip to content

Commit

Permalink
[Add] WOSS Release 1.12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalKnight committed Jul 30, 2023
1 parent ca5e34f commit 1186795
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 52 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@ v1.12.4 - Added support for GEBCO 2022
- Fixed bug with WossDbManager
- Added TCL debug capabilities to Altimetry classes
- Refactored usage of streams' precision throughout the whole framework

v1.12.5 - Minor fixes to ns-Miracle classes
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# whose support is gratefully acknowledged.


AC_INIT([WOSS], [1.12.4], [woss@guerra-tlc.com])
AC_INIT([WOSS], [1.12.5], [woss@guerra-tlc.com])
AM_INIT_AUTOMAKE([foreign subdir-objects])

AC_MSG_NOTICE([WOSS AC_PACKAGE_VERSION])
Expand Down
5 changes: 4 additions & 1 deletion doxy/Mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @author Federico Guerra - federico@guerra-tlc.com
*
* @version 1.12.4
* @version 1.12.5
*
* This document provides a short techical description of the <i>World Ocean Simulation System</i> (WOSS) library
* and of its integration into <i>Multi InteRfAce Cross Layer Extension</i> (NS-Miracle).<p>
Expand Down Expand Up @@ -1307,6 +1307,9 @@
* <li> Added TCL debug capabilities to Altimetry classes
* <li> Refactored usage of streams' precision throughout the whole framework
* </ul>
* <li> <b>v.1.12.5</b> <ul>
* <li> minor fixes to ns-Miracle classes
* </ul>
* </ul>
**/

Expand Down
3 changes: 1 addition & 2 deletions samples/test_aloha_hamburg_port_bathy.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ $woss_creator setSimulationTimes 0 0 1 1 2010 0 0 1 2 1 2010 0 0 1

WOSS/Manager/Simple/MultiThread set debug 0
WOSS/Manager/Simple/MultiThread set is_time_evolution_active -1.0
WOSS/Manager/Simple/MultiThread set concurrent_threads 0
WOSS/Manager/Simple/MultiThread set space_sampling 0.0
set woss_manager [new "WOSS/Manager/Simple/MultiThread"]

$woss_manager setConcurrentThreads 0

WOSS/Utilities set debug 0
set woss_utilities [new "WOSS/Utilities"]
Expand Down
15 changes: 8 additions & 7 deletions samples/test_aloha_no_dbs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ $woss_creator setSimulationTimes 0 0 1 12 2009 0 0 1 1 12 2009 0 0 1
WOSS/Manager/Simple/MultiThread set debug 0.0
WOSS/Manager/Simple/MultiThread set is_time_evolution_active -1.0
WOSS/Manager/Simple/MultiThread set space_sampling 0.0
WOSS/Manager/Simple/MultiThread set concurrent_threads 0
set woss_manager [new "WOSS/Manager/Simple/MultiThread"]
$woss_manager setConcurrentThreads 0


#### we create the mandatory woss::TransducerHandler
Expand All @@ -234,7 +234,7 @@ set transducer_handler [new "WOSS/Definitions/TransducerHandler"]
WOSS/Controller set debug 0
set woss_controller [new "WOSS/Controller"]
#uncomment if you wish to store results to a db on filesystem
#$woss_controller setTimeArrResultsDbCreator $db_res_arr
$woss_controller setTimeArrResultsDbCreator $db_res_arr
$woss_controller setWossDbManager $db_manager
$woss_controller setWossManager $woss_manager
$woss_controller setWossCreator $woss_creator
Expand Down Expand Up @@ -509,11 +509,8 @@ for {set id1 0} {$id1 < $opt(nn)} {incr id1} {
###############################

proc finish {} {
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel db_manager propagation
global woss_manager

# $woss_manager reset
$db_manager closeAllConnections
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel propagation
global woss_manager db_manager

puts "\n"

Expand Down Expand Up @@ -541,6 +538,10 @@ proc finish {} {

$ns flush-trace
close $opt(tracefile)

puts "Delete WOSS objects to force file operations"
delete $woss_manager
delete $db_manager
}

###################
Expand Down
9 changes: 5 additions & 4 deletions samples/test_aloha_no_dbs_waypoints.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ $woss_creator setSimulationTimes 0 0 1 1 2010 0 0 1 2 1 2010 0 0 1

WOSS/Manager/Simple/MultiThread set debug 0
WOSS/Manager/Simple/MultiThread set space_sampling 2.0
WOSS/Manager/Simple/MultiThread set concurrent_threads 0.0
set woss_manager [new "WOSS/Manager/Simple/MultiThread"]
$woss_manager setConcurrentThreads 0


WOSS/Definitions/TransducerHandler set debug 0
Expand Down Expand Up @@ -647,9 +647,7 @@ for {set id1 0} {$id1 < $opt(nn)} {incr id1} {
###############################

proc finish {} {
global ns opt cbr mac propagation cbr_auv mac_auv phy_data phy_data_auv channel db_manager

$db_manager closeAllConnections
global ns opt cbr mac propagation cbr_auv mac_auv phy_data phy_data_auv channel db_manager woss_manager

set totenergy 0.0
set total_cbr_tx_pkts 0.0
Expand Down Expand Up @@ -696,6 +694,9 @@ proc finish {} {
$ns flush-trace
close $opt(tracefile)

puts "Delete WOSS objects to force file operations"
delete $woss_manager
delete $db_manager
}


Expand Down
15 changes: 8 additions & 7 deletions samples/test_aloha_no_dbs_with_time_evolution.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ $woss_creator setSimulationTimes 0 0 1 1 2011 9 0 1 2 1 2011 1 0 1
#set woss_manager [new "WOSS/Manager/Simple"]

WOSS/Manager/Simple/MultiThread set debug 0.0
WOSS/Manager/Simple/MultiThread set is_time_evolution_active 10.0
WOSS/Manager/Simple/MultiThread set is_time_evolution_active 1.0
WOSS/Manager/Simple/MultiThread set space_sampling 0.0
WOSS/Manager/Simple/MultiThread set concurrent_threads 0
set woss_manager [new "WOSS/Manager/Simple/MultiThread"]
$woss_manager setConcurrentThreads 0


#### we create the mandatory woss::TransducerHandler
Expand Down Expand Up @@ -526,11 +526,8 @@ for {set id1 0} {$id1 < $opt(nn)} {incr id1} {
###############################

proc finish {} {
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel db_manager propagation
global woss_manager

# $woss_manager reset
$db_manager closeAllConnections
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel propagation
global db_manager woss_manager

puts "\n"

Expand Down Expand Up @@ -558,6 +555,10 @@ proc finish {} {

$ns flush-trace
close $opt(tracefile)

puts "Delete WOSS objects to force file operations"
delete $woss_manager
delete $db_manager
}

###################
Expand Down
11 changes: 7 additions & 4 deletions samples/test_aloha_with_dbs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ $woss_creator setSimulationTimes 0 0 1 1 2010 0 0 1 2 1 2010 0 0 1

WOSS/Manager/Simple/MultiThread set debug 0
WOSS/Manager/Simple/MultiThread set is_time_evolution_active -1.0
WOSS/Manager/Simple/MultiThread set concurrent_threads 0
WOSS/Manager/Simple/MultiThread set space_sampling 0.0
set woss_manager [new "WOSS/Manager/Simple/MultiThread"]
$woss_manager setConcurrentThreads 0


WOSS/Utilities set debug 0
Expand Down Expand Up @@ -552,9 +552,8 @@ for {set id1 0} {$id1 < $opt(nn)} {incr id1} {
###############################

proc finish {} {
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel db_manager propagation

$db_manager closeAllConnections
global ns opt cbr mac propagation cbr_sink mac_sink phy_data phy_data_sink channel propagation
global db_manager woss_manager

puts "\n"

Expand Down Expand Up @@ -582,6 +581,10 @@ proc finish {} {

$ns flush-trace
close $opt(tracefile)

puts "Delete WOSS objects to force file operations"
delete $woss_manager
delete $db_manager
}

###################
Expand Down
39 changes: 32 additions & 7 deletions woss/woss_def/altimetry-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,15 +702,31 @@ namespace woss {
* @return a <i>new</i> Altimetry object
**/
virtual AltimBretschneider* randomize( double ratio_incr_value ) const;



/**
* Configures H - the characteristic height of the wave [m]
* @param h characteristic height [m]
* @return AltimBretschneider reference to <i>this</i>
**/
AltimBretschneider& setCharacteristicHeight( double h ) { char_height = h; return *this; }


/**
* Configures T - the wave average period [s]
* @param h average period [s]
* @return AltimBretschneider reference to <i>this</i>
**/
AltimBretschneider& setAveragePeriod( double p ) { average_period = p; return *this; }



/**
* Gets H - the characteristic height of the wave [m]
* @return characteristic height [m]
**/
double getCharacteristicHeight() const { return char_height; }


/**
* Gets T - the wave average period [s]
* @return h average period [s]
**/
double getAveragePeriod() const { return average_period; }


Expand All @@ -719,9 +735,18 @@ namespace woss {

virtual AltimBretschneider& createWaveSpectrum();


/**
* H - Model's characteristic height [m]
* Refer to:
* G. J. Komen et al., Dynamics and modeling of ocean waves. Cambridge University Press, 1994.
*/
double char_height;

/**
* T - Model's average wave period [s]
* Refer to:
* G. J. Komen et al., Dynamics and modeling of ocean waves. Cambridge University Press, 1994.
*/
double average_period;

};
Expand Down
43 changes: 33 additions & 10 deletions woss_phy/tcl_hooks/woss-manager-simple-tcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,22 @@ namespace woss {

double debug_;

double is_time_evolution_active_;


double is_time_evolution_active_;
};



template< typename WMResDb >
WossManagerSimpleTcl< WMResDb >::WossManagerSimpleTcl()
: WossManagerSimple<WMResDb>()
{
TclObject::bind("debug", &this->debug_);
TclObject::bind("is_time_evolution_active", &this->is_time_evolution_active_);
TclObject::bind("is_time_evolution_active", &this->is_time_evolution_active_);
TclObject::bind("space_sampling",&this->space_sampling );

this->debug = (bool) this->debug_;
this->is_time_evolution_active = (bool) this->is_time_evolution_active_;
}

template< typename WMResDb >
template< typename WMResDb >
int WossManagerSimpleTcl< WMResDb >::command( int argc, const char*const* argv ) {
if(argc==2) {
if(strcasecmp(argv[1], "reset") == 0) {
Expand All @@ -126,9 +123,35 @@ namespace woss {
}
return TclObject::command(argc,argv);
}


#ifdef WOSS_MULTITHREAD
template<>
int WossManagerSimpleTcl< WossManagerResDbMT >::command( int argc, const char*const* argv ) {
if(argc==2) {
if(strcasecmp(argv[1], "reset") == 0) {

if (this->debug) ::std::cout << "WossManagerSimpleTcl::command() reset called" << ::std::endl;

if ( this->reset() ) return TCL_OK;
else return TCL_ERROR;
}
}
else if (argc==3) {
if(strcasecmp(argv[1], "setConcurrentThreads") == 0) {
int threads = atoi(argv[2]);

if (this->debug) ::std::cout << "WossManagerSimpleTcl::command() setConcurrentThreads "
<< threads << " called" << ::std::endl;

this->setConcurrentThreads(threads);

return TCL_OK;
}
}
return TclObject::command(argc,argv);
}
#endif // WOSS_MULTITHREAD
}


#endif // WOSS_NS_MIRACLE_SUPPORT

Expand Down
7 changes: 3 additions & 4 deletions woss_phy/uw-woss-phy-defaults.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ WOSS/Controller set debug 0.0

WOSS/Definitions/RandomGenerator/C set seed_ 1

# WOSS/Manager/Simple/MultiThread set max_thread_number 9
# WOSS/Manager/Simple/MultiThread set is_time_evolution_active -1.0
# WOSS/Manager/Simple/MultiThread set debug 0.0
# WOSS/Manager/Simple/MultiThread set space_sampling 0.0
#WOSS/Manager/Simple/MultiThread set is_time_evolution_active -1.0
#WOSS/Manager/Simple/MultiThread set debug 0.0
#WOSS/Manager/Simple/MultiThread set space_sampling 0.0

PacketHeaderManager set tab_(PacketHeader/WOSS) 1

Expand Down
13 changes: 11 additions & 2 deletions woss_phy/uw-woss-waypoint-position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static class WossWpPositionClass : public TclClass {
WossWpPosition::WossWpPosition()
: time_threshold(1e-5),
last_time_update(0.0),
current_speed(0.0),
waypoint_vect(),
timeid_map()
{
Expand Down Expand Up @@ -232,6 +233,7 @@ void WossWpPosition::update( double time ) {
setLocation( pos );
updateVerticalOrientation( waypoint_vect[it->second - 1].getDestination(), pos );
updateBearing( waypoint_vect[it->second - 1].getDestination(), pos );
current_speed = waypoint_vect[it->second -1].getSpeed();
}

// ::std::cout << "WossWpPosition::update() update loc " << curr_coordz << ::std::endl;
Expand Down Expand Up @@ -328,7 +330,7 @@ woss::CoordZ WossWpPosition::getLocation() {


double WossWpPosition::getVerticalOrientation() {
double now = Scheduler::instance().clock();
double now = Scheduler::instance().clock();
if (now>last_time_update+time_threshold) update(now);

// ::std::cout << "WossWpPosition::getVerticalOrientation() vertical orientation " << vertical_orientation << ::std::endl;
Expand All @@ -337,11 +339,18 @@ double WossWpPosition::getVerticalOrientation() {


double WossWpPosition::getBearing() {
double now = Scheduler::instance().clock();
double now = Scheduler::instance().clock();
if (now>last_time_update+time_threshold) update(now);

// ::std::cout << "WossWpPosition::getBearing() current bearing " << ( bearing * 180.0 / M_PI ) << ::std::endl;
return bearing;
}


double WossWpPosition::getSpeed() {
double now = Scheduler::instance().clock();
if (now>last_time_update+time_threshold) update(now);

// ::std::cout << "WossWpPosition::getSpeed() current speed " << current_speed << ::std::endl;
return current_speed;
}
Loading

0 comments on commit 1186795

Please sign in to comment.