11 #ifndef VoltVarCtrl_HPP_ 12 #define VoltVarCtrl_HPP_ 19 #include "messages/ModuleMessage.pb.h" 29 #include <boost/shared_ptr.hpp> 30 #include <boost/date_time/posix_time/posix_time_types.hpp> 52 void vvc_Manage(
const boost::system::error_code& err);
60 ModuleMessage
VoltageDelta(
unsigned int cf,
float pm, std::string loc);
62 ModuleMessage
Gradient(arma::mat grad);
63 ModuleMessage
PrepareForSending(
const VoltVarMessage& message, std::string recipient);
72 void VVCManage(
const boost::system::error_code& err);
74 void FirstRound(
const boost::system::error_code& err);
void ScheduleNextRound()
Schedules the LoadManage that runs next round.
Definition: VoltVarCtrl.cpp:281
void vvc_Manage(const boost::system::error_code &err)
CBroker::TimerHandle m_RoundTimer
Timer handle for the round timer.
Definition: VoltVarCtrl.hpp:91
std::string m_Leader
The coordinator of the group.
Definition: VoltVarCtrl.hpp:110
void HandleLineReadings(const LineReadingsMessage &m, CPeerNode peer)
Definition: VoltVarCtrl.cpp:135
ModuleMessage VoltageDelta(unsigned int cf, float pm, std::string loc)
Definition: VoltVarCtrl.cpp:164
void FirstRound(const boost::system::error_code &err)
The code that runs the firtst round of the LB phase.
Definition: VoltVarCtrl.cpp:219
void HandlePeerList(const gm::PeerListMessage &m, CPeerNode peer)
Definition: VoltVarCtrl.cpp:152
void vvc_main()
Updates the node's state.
Definition: VoltVarCtrl.cpp:324
float m_MigrationStep
The amount to migrate.
Definition: VoltVarCtrl.hpp:102
float m_PredictedGateway
The gateway that we predict will be met by the devices.
Definition: VoltVarCtrl.hpp:100
void HandleGradient(const GradientMessage &m, CPeerNode peer)
Definition: VoltVarCtrl.cpp:141
VVCAgent()
Definition: VoltVarCtrl.cpp:46
void HandleIncomingMessage(boost::shared_ptr< const ModuleMessage > msg, CPeerNode peer)
First handler for an incoming message.
Definition: VoltVarCtrl.cpp:88
float m_NetGeneration
The amount of generation created by attached devices.
Definition: VoltVarCtrl.hpp:98
int Run()
Definition: VoltVarCtrl.cpp:68
const boost::posix_time::time_duration ROUND_TIME
The amount of time it takes to do an VVC round.
Definition: VoltVarCtrl.hpp:86
Base interface for agents/broker modules.
Definition: CPeerNode.hpp:37
CBroker::TimerHandle m_WaitTimer
Timer handle for the request timer.
Definition: VoltVarCtrl.hpp:93
void VVCManage(const boost::system::error_code &err)
The code that the supply nodes use to start doing migrations.
Definition: VoltVarCtrl.cpp:249
Definition: VoltVarCtrl.hpp:44
float m_Gateway
The gateway of this node.
Definition: VoltVarCtrl.hpp:96
ModuleMessage Gradient(arma::mat grad)
Definition: VoltVarCtrl.cpp:187
PeerSet m_peers
Definition: VoltVarCtrl.hpp:57
const boost::posix_time::time_duration REQUEST_TIMEOUT
The time it takes to get a draftrequest response.
Definition: VoltVarCtrl.hpp:88
void HandleVoltageDelta(const VoltageDeltaMessage &m, CPeerNode peer)
Definition: VoltVarCtrl.cpp:128
unsigned int TimerHandle
Definition: CBroker.hpp:66
An interface for an object which can handle recieving incoming messages.
Definition: IDGIModule.hpp:36
bool m_Synchronized
If the system is synchronized with the physical system.
Definition: VoltVarCtrl.hpp:107
ModuleMessage PrepareForSending(const VoltVarMessage &message, std::string recipient)
Definition: VoltVarCtrl.cpp:201
~VVCAgent()
Definition: VoltVarCtrl.cpp:57
General FREEDM Namespace.
Definition: CBroker.cpp:53
ModuleMessage LineReadings(std::vector< float > vals)
Definition: VoltVarCtrl.cpp:174
std::string m_leader
Definition: VoltVarCtrl.hpp:58
std::map< std::string, CPeerNode > PeerSet
Provides a PeerSet type for a module templated on T.
Definition: PeerSets.hpp:35
float m_PowerDifferential
The powerflow used by the physical invariant.
Definition: VoltVarCtrl.hpp:104
void ReadDevices()
Updates the state from the devices.
Definition: VoltVarCtrl.cpp:306