FAQ

Some questions are frequently asked. We tried to answer them here to help you solve one or the other common issue when getting started with the TAC Energy Server and demo client.

I get a LifecycleException or BindException: Protocol handler initialization failed Error. What can I do

This error occurs if you try to run to different programs, e.g. the TAC Energy Server and the TAC Energy Demo client at the same port. By default both programs try listen on port 8080 and this leads to the conflict as ports cannot be shared. Make sure that one of the programs uses a different port. For grails you can use the following command line parameter to change the port:

grails -Dserver.port=8090 run-app

Where can I download the TAC Energy Demo client?

You can download the source code of the client from its development homepage at http://launchpad.net/tacenergydemo

The latest binaries are available for download at the CI Server.

I want to run a TAC Energy server and a TAC Energy demo client on my machine in parallel. What do I have to do?

Make sure that server and client run on different ports. To switch the port for your TAC Energy client from 8080 (default) to e.g. 8090, start the agent with the following command line arguments:

grails -Dserver.port=8090 run-app

For more information on how to install TAC Energy Server and TAC Energy Client on your machine please refer to Installation section of this guide.

If a competition instance is deleted on the server, why is it not automatically deleted on the client too?

The client is owner of his own local data and responsible for handling it. Enforced deletion of (parts of) this data via a server signal might be counterproductive, e.g. in case an agent programmer wants to do some post analysis on the performance of his client based on the data stored in the agent's database.

If you want to automatically delete competition data you can use one of the provided listeners in the AgentStrategyService to accomplish this for example by using the code snippet below.

def onCompetitionReceived(Competition competitionInstance, String rawXml) {
  log.info "Competition received: ${competitionInstance}"

if (competitionInstance.action == ActionType.Stopped || competitionInstance.action == ActionType.Reset) { deleteAllLocalData(competitionInstance) } }

private deleteAllLocalData(Competition competitionInstance) { Forecast.executeUpdate('delete from Forecast f where f.competition = ?', [competitionInstance]) DepotPosition.executeUpdate('delete from DepotPosition d where d.competition = ?', [competitionInstance]) CashPosition.executeUpdate('delete from CashPosition c where c.competition = ?', [competitionInstance]) Orderbook.executeUpdate('delete from Orderbook o where o.competition = ?', [competitionInstance]) Shout.executeUpdate('delete from Shout s where s.competition = ?', [competitionInstance]) TradeLog.executeUpdate('delete from TradeLog t where t.competition = ?', [competitionInstance]) QuoteLog.executeUpdate('delete from QuoteLog q where q.competition = ?', [competitionInstance]) Product.executeUpdate('delete from Product p where p.competition = ?', [competitionInstance]) }

How exactly is the deactivation of future products based on the "Deactivate ahead" option realized?

Example: With the "Deactivate ahead" option set to 1 (default) and a time slot length of 60 minutes (default) trading for products is suspended one hour ahead of competition time. You will see a scenario like this:

Competition Time: 00:00
[00:00-00:59]: Stopped
[01:00-01:59]: Started
[02:00-02:59]: Started

The first time slot is deactivated, and in order to ensure that you will receive a forecast that represents the real energy demand when trading is already deactivated, the competition time has to be 00:00, although you might expect (01:00-01:59) to be deactivated since the competition time is already at 00:00.