Presentation on theme: "Termite Construction and Agent-Based Simulation"— Presentation transcript:
1Termite Construction and Agent-Based Simulation Dan Ladley,Leeds University Business School and School of Computing
2Social InsectsSocial insects such as termites, ants and bees successfully accomplish many complex tasks through cooperation.These include:Locating food sourcesBuilding nestsDividing labourBrood Sorting
3Computing Applications Insects have evolved solutions to challenging distributed coordination problems which have been successfully adapted to real world systems.Locating food sources -> Shortest path algorithmsBuilding nests -> Nano-technology, Space ExplorationDividing labour -> Task Allocation problemsBrood Sorting > Graph partitioning, data analysis
4Termite nest formation Many individual termites participate in the construction of termite nests. Due to the large size of the next relative to individual termites and the number of individuals involved this is a difficult coordination problem.The most common ways of coordination are:Blueprint LeaderPlan Template
5StigmergyThe above methods do not work for termites instead they employ stigmergy. Cues in the environment encourage termites to make certain behaviours which in turn effect the environment effecting future behaviours.Termites respond to many environmental cues. These include:PheromonesCement, Queen, TrailTemperatureAir MovementsHumidity
6Structures Formed Domes Pillars Walls Entrances Tunnels Air conditioningFungus farms
7Previous ModelDemonstrated the existence of pillars, chambers, galleries and covered pathsNo consideration of logistic factors or inactive materialE. Bonabeau, G. Theraulaz, J-L. Deneubourg, N. Franks, O. Rafelsberger, J-L. Joly, S. Blanco. A model for the emergence of pillars, walls and royal chambers in termite mounds. Philosophical Transactions of the Royal Society of London, Series B, 353: , 1998.
8Agent Based Model Three dimensional discrete world Populated by a finite number of ‘termites’Three pheromone typesCement – given off by recently placed materialTrail – given off by moving termitesQueen – given off by stationary queenDiffusion through finite volume method
9Agent Movement May move to any adjacent location as long as There is no building material presentThe new location is adjacent to materialMovement influenced by cement pheromoneRoulette wheel selection based on pheromone gradientsRandom Movement with probability 1/Gradient
10Agent Building Behaviour Probability of building when queen pheromone level lies in a particular rangeCrude physicsNewly placed material gives off cement pheromone
19Pros and Cons of this model Reproduces results seen in natureImportance of logistic constraintsApplications in real situations – space exploration, nano-tech…Simplistic movement strategyArtefacts due to tessellation of worldNo accounting for castes of termites
20Agent-based modelling is employed in other fields, in particular it is key to current research in epidemiology, transport studies and defence.Many fields investigate problems involving many interacting individuals engaging in potentially complex and changing relationships which are frequently difficult to analyse with more traditional techniques.
21Agent Based Models Allow the investigation of: Heterogeneous individualsBounded rationalityComplex relationshipsThe time path or dynamics of a system
22Agent-Based Models These models have draw backs: They do not provide proofs only demonstrations of sufficiencyThere are typically many ways to model any given situationParameters, parameters and more parameters
23£14 A Game: It’s January 1926 you have £1 to invest If you invested it in US Treasury bills, one of the safest bets around, and reinvested all of the proceeds how much would you have now?£14
24If you invested it in the S&P 500 index (the stock market), a much riskier bet, how much would you have now?£1370
25Now suppose that each month you were able to divine which would do better and invested everything in that, how much would you have?£2,296,183,456
26MotivationIn order to predict what is going on in financial market it is vital to separate the effect of the market mechanism and individual behaviour.The order book market mechanism is employed (with variations) in the majority of the worlds major financial institutions.
27Similar to a continuous double auction Order book marketsSimilar to a continuous double auctionTraders submit orders to the marketMarket Orders execute immediately at the best available price for the specified quantityLimit Orders are added to the order book at the specified quantity and priceTrade results in limit orders being removed from the book
28Example order book Buy Order Sell Order 10 20 30 40 41 42 43 44 45 46 47484950515253545556575859Price
29Example order book Buy Order Sell Order 10 20 30 40 41 42 43 44 45 46 47484950515253545556575859PriceBest AskBest BidSpread
30Understanding order book markets Analytical work - Difficult to maintain analytical tractabilityEmpirical and experimental work - Difficult to separate trader strategy from the effect of the market mechanismSimulation work – how should the traders agents behave?
31Solution - Zero Intelligence Traders modelled to behave randomly, consequently any effects observed in the data are due to the market mechanism. Those not observed are then dependant on individual behaviour.Observed Behaviour=Effect of Trader Strategy+Effect of Market Mechanism
32Agent-Based Model100 traders each initially allocated 50 units to either buy or sell with reservation prices stepped between 0 and 100Each time step one trader selected at random to submit an order for a random number of units at a random price drawn from a uniform integer distribution constrained by the limit prices of the traders unitsWith a set probability new traders enter and leave the market each time step
33Orders classified into 12 types based on aggressiveness (Biais et al Buy OrdersSell Orders1Market larger quantity72Market equal quantity83Market smaller quantity94Limit between quotes105Limit at quote116Limit below Quote12
34Order Book Mechanism Sell Order Buy Order 10 20 30 11 12 13 14 15 16 171819212223242526272829Price1,2,3654
36Also predicts:Details of the bid ask spreadIntra-book spreadsQuantities available at the quotesEffect of changes of the tick sizeImportance of the tips of the order book (Griffith et al etc.)Correlation between price movements and order book shape (Huang & Stoll 1994, Parlour 1998 etc.)
37ConclusionsMuch of the order dynamics typically observed in markets can be explained as a consequence of the order book market mechanismIn many cases trader strategy may not be the dominant force in observed market behaviourHowever this is only half of the story we still need to understand the strategies employed by traders
38Model as before, except… The agents are now trading a financial asset (e.g. a stock in a company) and moneyThey are paid dividends and interest and must consume a fraction of their wealth each time stepThey are subject to margin constraints a limit on the amount of money a trader may borrow to some fraction of there net-worthAnd the traders have strategy…
39Genetic ProgramsPrograms are provided with the 8 input parameters (information about the market)Two outputs, the quantity and price are returnedQuantity – Rounded to Integer ValuesPrice – Rounded to [0,1] then mapped to [10000,20000]Three registers for variable manipulation are provided
40Genetic Program Example InstructionProgram1R0 = 22R1 = ps3R0 = R0 * R14R1 = R1 – pb5Return R0Results2ps
41Genetic Programming Tournaments One Tournament per trading period4 Individuals selected at randomFitness equal to net worth2 Least fit individuals have their strategies replaced
47ConclusionsThere exists an optimal level of market regulation reducing bankruptcyTraders strategies depend heavily on the level of borrowing allowedAgent-based models can provide insights into these systems unachievable with other techniques.