27 #ifndef CONNECTION_UPDATER_H 28 #define CONNECTION_UPDATER_H 38 #include "nestmodule.h" 39 #include "dictdatum.h" 41 #include "connection_manager_impl.h" 42 #include "connector_model_impl.h" 43 #include "kernel_manager.h" 116 void init(nest::index cu_model_id);
117 void setup(
long interval,
long exceptable_latency);
119 void register_connector(nest::ConnectorBase* new_conn, nest::ConnectorBase* old_conn, nest::index sender_gid,
120 nest::thread th, nest::synindex syn_id);
123 nest::thread target_thread, nest::synindex syn_id);
138 return acceptable_latency_;
146 return interval_ + acceptable_latency_ + nest::kernel().connection_manager.get_min_delay();
154 return nest::kernel().simulation_manager.get_slice_origin();
162 return get_origin() - nest::Time(nest::Time::step(interval_ + acceptable_latency_));
170 return (interval_ > 0) && (acceptable_latency_ >= 0) && (cu_id_ != nest::invalid_index);
178 return has_connections_;
186 return is_initialized_;
199 void execute_garbage_collector(nest::thread th);
200 void update(
const nest::Time& time, nest::thread th);
201 void calibrate(nest::thread th);
202 void finalize(nest::thread th);
210 class ConnectionEntry
213 ConnectionEntry( nest::ConnectorBase* connector, nest::Node* sender=0 )
214 : connector_(connector),
219 ConnectionEntry(
const ConnectionEntry& src )
220 : connector_(src.connector_),
226 bool operator==(
const ConnectionEntry& conn)
const 228 return (conn.connector_ == connector_);
231 bool operator!=(
const ConnectionEntry& conn)
const 233 return (conn.connector_ != connector_);
236 bool operator<=(
const ConnectionEntry& conn)
const 238 return (conn.connector_ <= connector_);
241 bool operator>=(
const ConnectionEntry& conn)
const 243 return (conn.connector_ >= connector_);
246 bool operator<(
const ConnectionEntry& conn)
const 248 return (conn.connector_ < connector_);
251 bool operator>(
const ConnectionEntry& conn)
const 253 return (conn.connector_ > connector_);
256 const ConnectionEntry& operator=(
const ConnectionEntry& conn)
259 connector_ = conn.connector_;
260 sender_ = conn.sender_;
264 nest::ConnectorBase* get_connector()
const 269 nest::Node& get_sender()
const 276 nest::ConnectorBase* connector_;
283 class GarbageCollectorEntry
286 GarbageCollectorEntry(nest::index target_gid, nest::index sender_gid, nest::synindex syn_id)
287 : target_gid_(target_gid),
288 sender_gid_(sender_gid),
293 GarbageCollectorEntry(
const GarbageCollectorEntry& src)
294 : target_gid_(src.target_gid_),
295 sender_gid_(src.sender_gid_),
300 const GarbageCollectorEntry& operator=(
const GarbageCollectorEntry& src)
302 target_gid_ = src.target_gid_;
303 sender_gid_ = src.sender_gid_;
304 syn_id_ = src.syn_id_;
308 nest::index get_target_gid()
const 313 nest::index get_sender_gid()
const 318 nest::synindex get_syn_id()
const 324 nest::index target_gid_;
325 nest::index sender_gid_;
326 nest::synindex syn_id_;
332 std::vector< std::set< ConnectionEntry > > connectors_;
337 std::vector< std::set< nest::synindex > > used_models_;
342 std::vector< std::vector< GarbageCollectorEntry > > garbage_pile_;
344 long acceptable_latency_;
346 nest::index cu_model_id_;
348 bool has_connections_;
349 bool is_initialized_;
364 virtual void update(nest::Time
const& origin,
const long from,
const long to);
365 virtual void calibrate();
366 virtual void finalize();
368 void get_status(DictionaryDatum&)
const;
369 void set_status(
const DictionaryDatum&);
372 bool has_proxies()
const 378 bool one_node_per_process()
const 385 virtual void init_buffers_();
386 virtual void init_state_(
const nest::Node& proto);
410 virtual Event* clone()
const 412 throw nest::KernelException(
"Trying to call clone() of a SynapseUpdateEvent is illegal!");
419 virtual void operator()()
421 throw nest::KernelException(
"Trying to send a SynapseUpdateEvent is illegal!");
~ConnectionUpdateManager()
Definition: connection_updater.cpp:52
bool is_initialized() const
Definition: connection_updater.h:184
Class that manages updating diligent connections.
Definition: connection_updater.h:110
Nest node to handle synapse updates on regular time grid.
Definition: connection_updater.h:357
void init(nest::index cu_model_id)
Definition: connection_updater.cpp:103
nest::delay get_acceptable_latency() const
Definition: connection_updater.h:136
void trigger_garbage_collector(nest::index target_gid, nest::index sender_gid, nest::thread target_thread, nest::synindex syn_id)
Definition: connection_updater.cpp:211
bool has_connections() const
Definition: connection_updater.h:176
nest::Time get_origin() const
Definition: connection_updater.h:152
ConnectionUpdateManager()
Definition: connection_updater.cpp:39
void register_connector(nest::ConnectorBase *new_conn, nest::ConnectorBase *old_conn, nest::index sender_gid, nest::thread th, nest::synindex syn_id)
Definition: connection_updater.cpp:160
nest::delay get_max_latency() const
Definition: connection_updater.h:144
nest::Time get_horizon() const
Definition: connection_updater.h:160
The dummy event class used to trigger synapse updates.
Definition: connection_updater.h:397
static ConnectionUpdateManager * instance()
Definition: connection_updater.cpp:312
nest::delay get_interval() const
Definition: connection_updater.h:128
void setup(long interval, long exceptable_latency)
Sets up the ConnectionUpdateManager with the given update interval and acceptable latency...
Definition: connection_updater.cpp:69
Global namespace holding all classes of the SPORE NEST module.
Definition: circular_buffer.h:31
bool is_valid() const
Definition: connection_updater.h:168