Package agents.trader
Class Trader
- java.lang.Object
-
- de.dlr.gitlab.fame.agent.Agent
-
- agents.trader.Trader
-
- All Implemented Interfaces:
DayAheadMarketTrader
,de.dlr.gitlab.fame.agent.AgentAbility
- Direct Known Subclasses:
DemandTrader
,FlexibilityTrader
,GreenHydrogenTrader
,ImportTrader
,TraderWithClients
public abstract class Trader extends de.dlr.gitlab.fame.agent.Agent implements DayAheadMarketTrader
Abstract base class for all traders atDayAheadMarket
- Author:
- Christoph Schimeczek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Trader.Products
Products ofTrader
s-
Nested classes/interfaces inherited from class de.dlr.gitlab.fame.agent.Agent
de.dlr.gitlab.fame.agent.Agent.WarmUpStatus
-
Nested classes/interfaces inherited from interface agents.markets.DayAheadMarketTrader
DayAheadMarketTrader.OutputColumns
-
-
Field Summary
-
Fields inherited from interface agents.markets.DayAheadMarketTrader
ERR_CLEARING_TIMES_AMBIGUOUS, ERR_CLEARING_TIMES_MISSING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ArrayList<MarginalsAtTime>
extractMarginalsAtTime(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
ReadsMarginalsAtTime
from given messages, assuming they are valid at the same time stampprotected de.dlr.gitlab.fame.communication.Contract
getMatchingContract(List<de.dlr.gitlab.fame.communication.Contract> contracts, long agentId)
protected ArrayList<Marginal>
getSortedMarginalList(ArrayList<MarginalsAtTime> allMarginals)
protected TreeMap<de.dlr.gitlab.fame.time.TimeStamp,ArrayList<MarginalsAtTime>>
sortMarginalsByTimeStamp(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
ReadsMarginalsAtTime
from given messages and sorts them by the time stamp they are valid at-
Methods inherited from class de.dlr.gitlab.fame.agent.Agent
addContract, call, closeChannel, executeActions, executeWarmUp, fulfilNext, fulfilNext, getId, getNextRandomNumberGenerator, getPostOffice, handleMessage, initialiseActions, now, openChannel, publish, receive, sendMessageTo, sendMessageTo, store, store, toString, warmUp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.dlr.gitlab.fame.agent.AgentAbility
call, fulfilNext, fulfilNext, getId, getNextRandomNumberGenerator, now, store, store
-
Methods inherited from interface agents.markets.DayAheadMarketTrader
extractTimesFromGateClosureInfoMessages, readGateClosureInfoMessage
-
-
-
-
Constructor Detail
-
Trader
public Trader(de.dlr.gitlab.fame.agent.input.DataProvider dataProvider)
Creates aTrader
- Parameters:
dataProvider
- provides input from config
-
-
Method Detail
-
sortMarginalsByTimeStamp
protected TreeMap<de.dlr.gitlab.fame.time.TimeStamp,ArrayList<MarginalsAtTime>> sortMarginalsByTimeStamp(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
ReadsMarginalsAtTime
from given messages and sorts them by the time stamp they are valid at- Parameters:
messages
- containing MarginalsAtTime - to be sorted by time stamp- Returns:
- a Map of MarginalsAtTime sorted by the
TimeStamp
they are valid at
-
extractMarginalsAtTime
protected ArrayList<MarginalsAtTime> extractMarginalsAtTime(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
ReadsMarginalsAtTime
from given messages, assuming they are valid at the same time stamp- Parameters:
messages
- containing MarginalsAtTime to be extracted- Returns:
- List of MarginalsAtTime contained in given messages
-
getSortedMarginalList
protected ArrayList<Marginal> getSortedMarginalList(ArrayList<MarginalsAtTime> allMarginals)
-
getMatchingContract
protected de.dlr.gitlab.fame.communication.Contract getMatchingContract(List<de.dlr.gitlab.fame.communication.Contract> contracts, long agentId)
- Parameters:
contracts
- whose receivers are searched for given agentIdagentId
- to search for- Returns:
- first matching contract from given list of
Contract
s where the given agentID is receiver
-
-