Tuesday 1 September 2009


Last week of writing my project report and in my twitter today found a link to that interesting article about AI, so thought to share it here.
I'll upload the dissertation after the marking to avoid potential problems with plagiarism.
Probably I wouldn't update this blog as from next week, but who knows maybe will open a new blog.

Wednesday 22 July 2009

Tournament finale

My specialist reached the 8th out of 14th active specialists. there were 18 participants, but 4 finished with score 0.
The best performance of my specialist was on the last day and the second day the performance were the poorest one. The reason is unknown to me yet, I know though in the last day I used different accepting policy than the first 2 days and I might had problem with my compiled code on the 2nd day that accepted too many shouts that led to low transaction score, which led eventually to poor result on the 2nd day.

Thursday 9 July 2009

Tournament is starting today

The tournament is starting today at 14:00GMT.
You can watch the results live on http://bit.ly/jcatlive

Tuesday 7 July 2009

Pricing policy error

I found that in ScheduleBalancingPricingPolicy of JCAT the k isn't updated correctly, probably due to casting between int and double.

Monday 29 June 2009

Machine learning resources

I found on youtube a podcast on Machine learning by Professor Andrew Ng from Stanford university.
There are 20 lectures in that series on youtube.

Sunday 28 June 2009

debug in Netbeans

JCAT has 3 different methods to run. I tried Debug of the JCAT code on my Netbeans 6.5 and it seems it works very slowly. As JCAT doesn't come as a netbeans project I used the free form to import it and I'm not sure if that cause the debug to be slow and whether I had in creating the project to configure something with the debugging.

Saturday 27 June 2009

count down and data analyse

only 12 days left to the opening shot. so far I've run several simulations related to the fees. I struggled to analyse the logs generated by JCAT. I used Microsoft Excel and NeoOffice the equivalent of OpenOffice for Mac and couldn't find an easy way to process efficient way to process the huge amount of data. I was advised to try Pivot table that the term in Excel and Data pilot in NeoOffice. I don't master that feature yet, but indeed it makes life simpler.

In order to analyse the effect of different variables, I kept all static, but one of them, adjust that variable to 5-7 different values and compared. I'm not going to write my outcome here, but I can tell that best not to keep fees fixed during the whole duration of the game and they need to be adjusted.

Running the game on my computer I observed that it runs on different speeds, depends on the computer processor when selecting the CallBasedInfrastructureImpl in the config file, there are also different configurations for the clock that I haven't yet checked the difference in the API. It's possible to simultaneously multiple games on one machine, just had to change the params file to write the log to different files and when running ant using the parameter -Dparams to run the game with different params file.

Saturday 20 June 2009


I noticed that transactions in my experiments even though tested it with one market isn't 1, it means for some reasons there are shouts that fail. i chose equal number of sellers and buyers and they all chose that market. That also effected the profit, but as it's a single market game we got full score.

I didn't pay attention much to configuration of traders in tests until I read the paper Some preliminary results on competition between markets for automated traders which can make difference even to the issue I discussed above.

Thursday 18 June 2009


Ideas for ideal strategies might arise? well I thought so, but soon I found I need to run experiments and explore how different strategies when tuning their parameters affect the scoring.

I ran several experiments of 10 identical specialists and it was interesting to find big deviation in the score between the best score to the worst. highest was 30.2 and worst was 20.4 in one game. I noticed the deviation remains similar, but spread over different specialist on different games. I ran 3 iterations in a game, so perhaps sometime the number of iteration needs to be high? well I'm not so sure yet about these results.

Tuesday 16 June 2009

Java version and Netbeans

This project isn't about Java, but IDE makes life easier, but it's a nightmare to configure it properly.
The jCAT requires a minimum of Java version 1.5 I tried to use the newest version which is version 6, but I got incompatible error when trying to run only the server. I made sure in the properties I change it to 1.5 and rebuild the project. This error is usually arise when using class compiled with newer Java version, perhaps it's something to do with the version of Java Ant uses as I had the problem both running within the Netbeans by right click on build.xml and select Run Target and selecting the Server or doing it from a shell (Mac) using Ant.

Sunday 14 June 2009

Trial starts tomorrow

In the last week I spent most of time setting up my computer to participate in the trial. by using the command ant specialist from the terminal (i run it on Mac), I create a jar file to run the specialist as a stand alone application and using params file I can configure my specialist. I'm not sure if I explained before what is specialist, so the specialist is the market that compete against other specialists and the one that gain the highest score win the tournament.

The CAT package has 3 running modes.
1. everything is running in a single process, this one is used to test my specialist against other specialist on my machine, I don't believe it's possible to use it if I got previous years implementation specialists as they are given complied without the code, hence there's option 2.
2. run different specialists and traders in different threads, it's much faster than option 3.
3. run in different processes and talk through the CATP protocol so theoretical can be on different machines. it slow down running of the game and used mostly during competition as specialist run from different machines in different part of the world.

I checked last week different ways how to use Statistical learning and Reinforcement learning for my specialist. I still in early stage here and try to find out which part of the process in bidding during a trading day I should insert the learning. This is something I'll do in the next 2 weeks.

I also found out that running specialists configured with the delivered CAT when running 2 specialist against the winning strategy of last year which is PersianCat lose all the way from day 1 or 2, as traders sometime select randomly a specialist, but fix it the next day as probably PersianCat offered better fees. I need to find out in the logs how I can get previous test results (fees).

Sunday 7 June 2009

Trial starts on the 15th June

In the week that starts on the 15th June, A trial of the tournament will be held. The purpose of the trial is to test whether the contesters can successfully connect to the server and participate.
This constraint forces me to focus on make sure that my specialist can connect to the game trial server at Liverpool university.
The document JCAT: The Software Platform for CAT Games was updated on the 1st May, one of the additions is explanation about the parameters of JCAT platform that enable to configure the specialist client from outside the code.

For the trial I'll run the game server and the specialist client on different processes. I might need to run additional specialists and traders for testing purpose.

My time plan hence is changed and until the 15th I will work on making sure I manage to connect to the game server. In case I manage to finish it before the 15th I should start work on selecting a strategy to implement. I read in AI book about different learning techniques and I'll choose the most suitable learning technique and implement it.

After the trial week I'll have 1-2 days to select which learning technique I'll implement, a week to implement it, 2-3 days to plan and build a test plan to compare my strategy to previous year participates and 2-3 days to run the tests. Which brings me to a week before the cometition.

Wednesday 29 April 2009

what next?

The document Overview of CAT: A Market Design Competition that summarize the tournament rules has been revised to version 2.0. I will get back to these document, but first I will discuss the issues I'm unsure relating to how to go forward and several technical issues relating to the tournament.
  • How to plug in past entries to the jCAT code?
  • Is it possible to plug them into the visualize simulation of the game? That is how I understand it according to footnote 1 of the new document, but I need to find how to use the libraries developed for these entries.
  • According to plan in preliminary report, I dedicated time to investigate market mechanisms and policies. I would like in this stage to go through the research paper again briefly and revise the time line to investigate these points.
In the revised document the changes are listed under bullet point 1.1.

According to point 2.4.1 I will want investigate the different possibilities to monitor my client during the course of game as there is no interface when running as client only. would sql be the answer?

How would I detect if client is disconnected from the game server? does the client try to establish the connection by itself?

Footnote 4,5 seems important related to information the client receive from the server for transactions that didn't happen for any reason.

The link in 3.3 to check the progress of the game, which includes the days which aren't trading days. What is it useful for?

In my preliminary research I didn't pay attention to the method traders choose market (randomly or using the n-armed bandit problem). It's discussed in 4.2 in the document.

Saturday 28 March 2009

Artificial Intelligence

One approach I would test its effectiveness in this project is machine learning. In the project group meeting I learned that I should check AI (Artificial Intelligence) and especially in the book by Stuart Russell and Peter Norvig - Artificial Intelligence: A Modern Approach.

The book is thick over 1000 pages, so I'm probably not going to read the whole of it, but I started with the introduction and it was quite interesting to learn about the evolution of AI.
Philosophy, Mathematics, Economics, Neuroscience, Psychology, Computer engineering, Control theory and Cybernetics and Linguistics contributed ideas, techniques and view points to AI. The summary of the introduction in Russell and Norvig book provides good explanation in brief on how each field contributed to AI.

The book provides 4 different learning techniques. Learning from Observations, Knowledge in Learning, Statistical Learning Methods and Reinforcement Learning. In the next post I'll review whether Learning from Observation would be useful to this project.

Thursday 19 March 2009


The easy way isn't always the easiest one. The code for the CAT Tournament is written in Java though one can write a client to communicate with the Tournament organisers server using CATP protocol (protocol written to talk with their server). It means if I decide to write a client in any other technology, but Java I have to write from scratch everything as a client already exist in Java and I just need to plug it into new libraries I will write that make the decisions.

These days almost everyone uses IDE to develop and as I have not much experience in Java I decided to go with NetBeans. First time I download the software was a couple of months ago and only today I feel that I'm confident enough to use it (still not mastering NetBeans) and this is after I have to work on a different project to build Plagiarism detection system and I used NetBeans.

Over a month ago I've already managed to run the code of jCat on NetBeans, but a few days ago wanted to use the Ant script to run separately the Market Client from running the whole package and realised that as I didn't use the free form to import the project NetBeans uses its own build script.

The new 6.5.1 version I upgraded to today have funny selection menu so spent a while to realise I define the Classpath only to the Source Packages and not also to the Test Packages, which gave me these annoying error messages all over.

Friday 27 February 2009

get ready! GO!!!

Today I start my first blog in order to motivate me documenting my MSc project. I always convince myself that my internal memory capacity is unlimited, but my supervisor raised some points why it's important to write those things.

To summarize the project into one sentence. I'm going to explore (research) automatic markets mechanisms. Full details about this tournament can be found if you follow this link.

I'm going to build an automatic market that compete against others markets to attract traders to choose my market over the competitors. Probably now you ask yourself why from the group of markets the traders will want to select my market?
I asked similar question myself yesterday while travelling home on the tube (underground train of London). The carriage was packed and one stop later it was almost completely empty, but only this carriage, which bring me to think when travelling on the tube, how people select which carriage to travel on? I can list a few strategies: nearest to entrance in the departure station, nearest to exit at the destination, randomly and etc... Traders would behave similar, different traders have different strategy to select a market.