Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
MonteCarlo Class Reference

#include <montecarlo.h>

Inheritance diagram for MonteCarlo:
Inheritance graph
Collaboration diagram for MonteCarlo:
Collaboration graph

Classes

class  BMscDealer
 
struct  Histogram
 
class  HMscDealer
 
class  Reject
 
struct  SimulationState
 

Public Types

typedef std::map< std::string,
Histogram
HistogramMap
 
typedef std::vector< std::pair
< std::string, double > > 
MeasurementList
 

Public Member Functions

 MonteCarlo ()
 
int do_sample (SimulationState &state, boost::lagged_fibonacci607 &seeder, const Msc *msc)
 
virtual void start (const MscPtr &msc)
 Start simulation and measurement calculation. More...
 
virtual void next ()
 Continue simulation. More...
 
virtual void stop ()
 Stop simulation. More...
 
virtual bool is_running () const
 Returns true if the simulation is started. More...
 
void thread_main (unsigned int seed, const Msc *msc)
 
- Public Member Functions inherited from Simulator
virtual ~Simulator ()
 
void set_process_count (int i)
 
void set_listener (SimulationListener *listener)
 
- Public Member Functions inherited from ConfigReader
 ConfigReader ()
 
 ConfigReader (ConfigProvider *config_provider)
 
virtual ~ConfigReader ()
 
void set_config_provider (ConfigProvider *config_provider)
 
ConfigProviderget_config_provider () const
 
long get_config_long (const std::wstring &section, const std::wstring &parameter, long def=0) const
 
float get_config_float (const std::wstring &section, const std::wstring &parameter, float def=0.0f) const
 
std::wstring get_config_string (const std::wstring &section, const std::wstring &parameter, std::wstring def=L"") const
 
- Public Member Functions inherited from Reporter
 Reporter ()
 
 Reporter (ReportPrinter *printer)
 
virtual ~Reporter ()
 
void set_printer (ReportPrinter *printer)
 
int print_report (TReportSeverity severity, const std::wstring &message)
 

Private Types

typedef boost::shared_ptr
< boost::thread > 
ThreadPtr
 

Private Attributes

MscPtr m_msc
 
volatile bool m_stoprequested
 
std::vector< ThreadPtrm_threads
 
boost::mutex m_mutex
 
boost::condition m_callback_condition
 
bool m_callback_active
 
HistogramMap m_histograms
 
float m_bin_width
 
float m_max_message_delay
 

Additional Inherited Members

- Protected Attributes inherited from Simulator
int m_process_count
 
SimulationListenerm_listener
 

Detailed Description

Definition at line 28 of file montecarlo.h.

Member Typedef Documentation

Definition at line 61 of file montecarlo.h.

typedef std::vector<std::pair<std::string, double> > MonteCarlo::MeasurementList

Definition at line 80 of file montecarlo.h.

typedef boost::shared_ptr<boost::thread> MonteCarlo::ThreadPtr
private

Definition at line 180 of file montecarlo.h.

Constructor & Destructor Documentation

MonteCarlo::MonteCarlo ( )

Member Function Documentation

int MonteCarlo::do_sample ( SimulationState state,
boost::lagged_fibonacci607 &  seeder,
const Msc msc 
)
virtual bool MonteCarlo::is_running ( ) const
inlinevirtual

Returns true if the simulation is started.

Implements Simulator.

Definition at line 171 of file montecarlo.h.

void MonteCarlo::next ( )
virtual

Continue simulation.

Implements Simulator.

Definition at line 412 of file montecarlo.cpp.

References m_callback_active, m_callback_condition, and m_mutex.

void MonteCarlo::start ( const MscPtr msc)
virtual

Start simulation and measurement calculation.

Implements Simulator.

Definition at line 384 of file montecarlo.cpp.

References ConfigReader::get_config_float(), m_bin_width, m_callback_active, m_histograms, m_max_message_delay, m_msc, Simulator::m_process_count, m_stoprequested, m_threads, and thread_main().

void MonteCarlo::stop ( )
virtual

Stop simulation.

Implements Simulator.

Definition at line 423 of file montecarlo.cpp.

References m_callback_active, m_callback_condition, m_msc, m_mutex, m_stoprequested, and m_threads.

void MonteCarlo::thread_main ( unsigned int  seed,
const Msc msc 
)

Member Data Documentation

float MonteCarlo::m_bin_width
private

Definition at line 188 of file montecarlo.h.

Referenced by MonteCarlo(), start(), and thread_main().

bool MonteCarlo::m_callback_active
private

Definition at line 185 of file montecarlo.h.

Referenced by MonteCarlo(), next(), start(), stop(), and thread_main().

boost::condition MonteCarlo::m_callback_condition
private

Definition at line 184 of file montecarlo.h.

Referenced by next(), stop(), and thread_main().

HistogramMap MonteCarlo::m_histograms
private

Definition at line 187 of file montecarlo.h.

Referenced by start(), and thread_main().

float MonteCarlo::m_max_message_delay
private
MscPtr MonteCarlo::m_msc
private

Definition at line 177 of file montecarlo.h.

Referenced by start(), and stop().

boost::mutex MonteCarlo::m_mutex
private

Definition at line 183 of file montecarlo.h.

Referenced by next(), stop(), and thread_main().

volatile bool MonteCarlo::m_stoprequested
private

Definition at line 179 of file montecarlo.h.

Referenced by MonteCarlo(), start(), stop(), and thread_main().

std::vector<ThreadPtr> MonteCarlo::m_threads
private

Definition at line 181 of file montecarlo.h.

Referenced by start(), and stop().


The documentation for this class was generated from the following files:

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:59 for Sequence Chart Studio by  doxygen