public class PeakShavingConcentrator extends Concentrator implements TransformingConcentrator
This class represents a PeakShavingConcentrator
component where several instances can be created.
The PeakShavingConcentrator
receives Bid
from the agents and forwards this in an aggregate
Bid
up in the hierarchy to a PeakShavingConcentrator
or to the Auctioneer
. It will receive
price updates from the Auctioneer
and forward them to its connected agents. TODO: add PeakShavingConcentrator
comment.
Modifier and Type | Class and Description |
---|---|
static interface |
PeakShavingConcentrator.Config |
BaseAgentEndpoint.Connected
AgentEndpoint.Status
Modifier and Type | Field and Description |
---|---|
protected double |
allocatedFlow
The allocated flow as calculated from the aggregated bidcurve
|
protected double |
ceiling
Maximum power level applied in 'peak shaving'
|
protected double |
floor
Minimum power level applied in 'peak shaving'
|
protected double |
measuredFlow
Measured flow as reported via the peak shaving interface
|
config
NOT_CONNECTED
Constructor and Description |
---|
PeakShavingConcentrator() |
Modifier and Type | Method and Description |
---|---|
void |
activate(java.util.Map<java.lang.String,?> properties)
OSGi calls this method to activate a managed service.
|
void |
activate(PeakShavingConcentrator.Config config)
Convenient activate method that takes a
PeakShavingConcentrator.Config object. |
void |
deactivate()
OSGi calls this method to deactivate a managed service.
|
protected double |
getUncontrolledFlow() |
void |
setMeasuredFlow(javax.measure.Measurable<javax.measure.quantity.Power> measuredFlow)
Sets the current measured flow for a transformer.
|
protected Bid |
transformBid(Bid aggregatedBid)
This method should be overridden when the bid that will be sent has to be changed.
|
protected Price |
transformPrice(Price price,
SentBidInformation info)
This method should be overridden when the price that will be sent down has to be changed.
|
activate, addObserver, agentEndpointDisconnected, connectToAgent, connectToMatcher, handleBidUpdate, handlePriceUpdate, matcherEndpointDisconnected, removeObserver, setContext
getAgentId, getDesiredParentId, getLastBidUpdate, getStatus, init, publishBid
now, publishEvent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToMatcher, getDesiredParentId, getStatus, handlePriceUpdate, matcherEndpointDisconnected
agentEndpointDisconnected, connectToAgent, handleBidUpdate
getAgentId, setContext
protected double floor
protected double ceiling
protected volatile double measuredFlow
protected volatile double allocatedFlow
public void activate(java.util.Map<java.lang.String,?> properties)
activate
in class Concentrator
properties
- the configuration propertiespublic void activate(PeakShavingConcentrator.Config config)
PeakShavingConcentrator.Config
object. This also makes subclassing easier.config
- The PeakShavingConcentrator.Config
object that configures this concentratorpublic void deactivate()
deactivate
in class Concentrator
protected Bid transformBid(Bid aggregatedBid)
Concentrator
transformBid
in class Concentrator
aggregatedBid
- The (input) aggregated bid as calculated normally (the sum of all the bids of the agents).Concentrator
.protected Price transformPrice(Price price, SentBidInformation info)
Concentrator
transformPrice
in class Concentrator
price
- The input price update as received from the connected matcher.info
- The information about the bid that has been sendPrice
as it has to be sent to the connected agents.protected double getUncontrolledFlow()
public void setMeasuredFlow(javax.measure.Measurable<javax.measure.quantity.Power> measuredFlow)
TransformingConcentrator
setMeasuredFlow
in interface TransformingConcentrator
measuredFlow
- The current power flow.