FREEDM DGI
|
#include <LoadBalance.hpp>
Public Member Functions | |
LBAgent () | |
int | Run () |
Protected Member Functions | |
CPeerNode | GetMe () |
Gets a CPeerNode representing this process. More... | |
std::string | GetUUID () const |
Gets the UUID of this process. More... | |
Private Types | |
enum | State { SUPPLY, DEMAND, NORMAL } |
Private Member Functions | |
void | DraftStandard (const boost::system::error_code &error) |
The code that runs after the draft request replies have arrived. More... | |
void | FirstRound (const boost::system::error_code &error) |
The code that runs the firtst round of the LB phase. More... | |
void | HandleCollectedState (const sc::CollectedStateMessage &m) |
Handles the collected state coming from state collection. More... | |
void | HandleCollectedState (const CollectedStateMessage &m) |
Handles the collected state coming from load balancing. More... | |
void | HandleDraftAccept (const DraftAcceptMessage &m, CPeerNode peer) |
Handles the draft accept message coming from the demand node. More... | |
void | HandleDraftAge (const DraftAgeMessage &m, CPeerNode peer) |
Handles the draft age message coming from the demand node. More... | |
void | HandleDraftRequest (const DraftRequestMessage &m, CPeerNode peer) |
Handles the draft request originating from the supply node. More... | |
void | HandleDraftSelect (const DraftSelectMessage &m, CPeerNode peer) |
Handles the draft select message coming from the supply node. More... | |
void | HandleEcnMessage (const ecn::EcnMessage &msg, CPeerNode) |
Handles incoming ECN notifications. More... | |
void | HandleIncomingMessage (boost::shared_ptr< const ModuleMessage > m, CPeerNode peer) |
First handler for an incoming message. More... | |
void | HandlePeerList (const gm::PeerListMessage &m, CPeerNode peer) |
Handles the peerlist coming from the group leader. More... | |
void | HandleStateChange (const StateChangeMessage &m, CPeerNode peer) |
Handles a node announcing its state change. More... | |
void | HandleTooLate (const TooLateMessage &m) |
Handles the draft reject message coming from the demand node. More... | |
bool | InvariantCheck () |
Check the invariant prior to starting a new migration. More... | |
void | LoadManage (const boost::system::error_code &error) |
The code that the supply nodes use to start doing migrations. More... | |
void | LoadTable () |
Displays the load table to show DGI state. More... | |
ModuleMessage | MessageCollectedState (float state) |
ModuleMessage | MessageDraftAccept (float amount) |
Generates the message that the demand node uses to confirm the migration. More... | |
ModuleMessage | MessageDraftAge (float age) |
Generates message demand nodes send in response to DraftRequest. More... | |
ModuleMessage | MessageDraftRequest () |
Generates message supply nodes send to demand nodes. More... | |
ModuleMessage | MessageDraftSelect (float amount) |
Generates the message that the supply node uses to select a demand node. More... | |
ModuleMessage | MessageStateChange (std::string state) |
Generates the message announcing current node state. More... | |
ModuleMessage | MessageStateCollection () |
Generates the message used to request a state collection. More... | |
ModuleMessage | MessageTooLate (float amount) |
Generates the message sent by the demand node to refuse migration. More... | |
int | MigrationRateFactor () |
Gives the current migration time scale. More... | |
void | MoveToPeerSet (PeerSet &ps, CPeerNode peer) |
Moves a peer to the specified peerset. More... | |
ModuleMessage | PrepareForSending (const LoadBalancingMessage &m, std::string recipient="lb") |
Boilerplate for preparing a message. More... | |
void | ReadDevices () |
Updates the state from the devices. More... | |
void | ScheduleNextRound () |
Schedules the LoadManage that runs next round. More... | |
void | ScheduleStateCollection () |
Sends the request to perform state collection. More... | |
void | SendDraftAccept (CPeerNode peer, float step) |
Sends draft accept to the specified peer. More... | |
void | SendDraftAge (CPeerNode peer) |
Sends draftage to the specified peer. More... | |
void | SendDraftRequest () |
Sends Draft request to all the demand peers. More... | |
void | SendDraftSelect (CPeerNode peer, float step) |
Sends a draft select to the specified peer. More... | |
void | SendTooLate (CPeerNode peer, float step) |
Sends too late to the specified peer. More... | |
void | SendToPeerSet (const PeerSet &ps, const ModuleMessage &m) |
Sends a message to all peers in a peerset. More... | |
void | SetPStar (float pstar) |
Sets PStar to the specified level. More... | |
void | Synchronize (float k) |
Synchronizes the Fast-Style Loadbalance with the physical system. More... | |
void | UpdateState () |
Updates the node's state. More... | |
Private Attributes | |
PeerSet | m_AllPeers |
All peers in group. More... | |
std::map< std::string, float > | m_DraftAge |
Pending migrations. More... | |
float | m_Gateway |
The gateway of this node. More... | |
PeerSet | m_InDemand |
Peers in the demand state. More... | |
PeerSet | m_InNormal |
Peers in the normal state. More... | |
PeerSet | m_InSupply |
Peers in the supply state. More... | |
std::string | m_Leader |
The coordinator of the group. More... | |
float | m_MigrationStep |
The amount to migrate. More... | |
float | m_NetGeneration |
The amount of generation created by attached devices. More... | |
float | m_PowerDifferential |
The powerflow used by the physical invariant. More... | |
float | m_PredictedGateway |
The gateway that we predict will be met by the devices. More... | |
CBroker::TimerHandle | m_RoundTimer |
Timer handle for the round timer. More... | |
int | m_soft_ecn_mode |
ecn state More... | |
State | m_State |
The current state of this peer. More... | |
bool | m_Synchronized |
If the system is synchronized with the physical system. More... | |
CBroker::TimerHandle | m_WaitTimer |
Timer handle for the request timer. More... | |
const boost::posix_time::time_duration | REQUEST_TIMEOUT |
The time it takes to get a draftrequest response. More... | |
const boost::posix_time::time_duration | ROUND_TIME |
The amount of time it takes to do an LB round. More... | |
|
private |
freedm::broker::lb::LBAgent::LBAgent | ( | ) |
|
private |
DraftStandard
|
private |
FirstRound
error | The reason this function was called. |
|
protectedinherited |
|
protectedinherited |
GetUUID
|
private |
HandleCollectedState
m | The message body that was recieved by this process. |
|
private |
HandleCollectedState
m | The message body that was recieved by this process. |
|
private |
HandleDraftAccept
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
HandleDraftAge
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
HandleDraftRequest
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
HandleDraftSelect
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
msg | the details of the received ECN message peer Always the current process. |
Set a timer for the soft ECN state to be cleared.
|
privatevirtual |
HandleIncomingMessage "Downcasts" incoming messages into a specific message type, and passes the message to an appropriate handler.
m | the incoming message |
peer | the node that sent this message (could be this DGI) |
Implements freedm::broker::IDGIModule.
|
private |
HandlePeerList
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
HandleStateChange
m | The message body that was recieved by this process. |
peer | The process that the message orginated from. |
|
private |
HandleTooLate
m | The message body that was recieved by this process. |
|
private |
InvariantCheck
|
private |
LoadManage
|
private |
LoadTable
|
private |
MessageCollectedState
state | the normal value to send out. |
|
private |
MessageDraftAccept
|
private |
MessageDraftAge
|
private |
MessageDraftRequest
|
private |
MessageDrafting
|
private |
MessageStateChange
state | is a string describing the new state of Load Balancing |
|
private |
MessageStateCollection
|
private |
MessageTooLate
|
private |
MigrationRateFactor
MoveToPeerSet Moves the given peer to the given peerset, removing it from all other categorized peersets (Normal, Supply Demand).
ps | The peerset to move the peer to. |
peer | the peer to move. |
|
private |
Wraps a LoadBalancingMessage in a ModuleMessage.
m | the message to prepare. If any required field is unset, the DGI will abort. |
recipient | the module (sc/lb/gm/clk etc.) the message should be delivered to |
|
private |
ReadDevices
int freedm::broker::lb::LBAgent::Run | ( | ) |
Run
|
private |
ScheduleNextRound
|
private |
ScheduleStateCollection
|
private |
|
private |
SendDraftAge
peer | The process to send this to. |
|
private |
SendDraftRequest
|
private |
SendDraftSelect
|
private |
|
private |
SendToPeerSet
m | The message to send |
ps | the processes to send the message to. |
|
private |
SetPStar
pstar | the new pstar setting to use. |
|
private |
Synchronize
k | The new value to use for m_PowerDifferential |
|
private |
UpdateState
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |