Video Of Day

Breaking News

The Blank Slate Work For Agent-Based Models


I create got taken a stab at edifice upwardly an agent-based simulator over the holidays. The state of progress would human face rather unimpressive, but that is near what I expected. The difficulty amongst edifice a complex software parcel is that it needs to locomote ready inwards a means that it tin locomote continuously tested. Unfortunately, the construction used requires a fair amount of software plumbing to locomote pose inwards place. Once the framework is laid up, nosotros in addition to then run across the steepest problem: it is real hard to define deportment for agents without other agents already inwards the model (the economic scheme is a "blank slate"). Once nosotros create got minimal laid of agents, it volition locomote a lot easier to develop novel behaviour, equally the novel agents volition create got an existing laid of relative prices to piece of work with.

Client-Server: Why?

(The code is available on GitHub: https://github.com/brianr747/Simple4Xpygame/tree/economic_engine It is however embedded equally a branch inwards some other project. Since I practise non create got a huge amount of fourth dimension to devote to this project, I am non going to suspension it out into a novel one.)

The determination to work a client-server architecture generates a fair amount of programming overhead. The organisation simulation is divided into ii distinct components.
  • The server keeps tracks of the "laws of physics" for the simulation: the inventory of each agent, the state of buy/sell orders on the market, in addition to production functions.
  • The clients communicate amongst the server, in addition to handgrip all decision-making. The decisions volition include sending orders to the markets, in addition to labor production decisions. 
Since the simulator all runs inside a unmarried process, the client-server blueprint presumably looks somewhat loopy. However, testing inwards a multi-process surroundings is a pain, thus I volition non add together inwards network communications until later. Building the framework to cleanly handgrip both networked in addition to non-networked modes was the biggest challenge I dealt amongst inwards the blueprint thus far.

The primal reward of the client-server architecture is flexibility. Each customer (an agent) tin locomote designed completely independently from other agents equally good equally the server. All that is required is that it interacts amongst other agents using the rules laid yesteryear the server. Another reward of the client-server blueprint is that it would locomote possible for others to build components inwards other reckoner languages if thus desired.

No Mathematical Model!

One of the side effects of the blueprint is that nosotros practise non genuinely create got a mathematical model of the simulation (other than observing that it is implemented on a digital computer). The clients in addition to server communicate via text messages that require parsing, in addition to each volition create got to build out its ain internal representation of the model.

From the server's perspective, the organisation state is simply the physical inventories of the agents, their cash balances, in addition to the existing laid of orders on exchanges. It volition also runway some transaction history, thus that agents tin work that information inwards their determination making.

However, that state information tells us real petty near the deportment of the simulation. We demand to augment it amongst the state of the customer decision-making processes. The server volition know zero near that information.

This could distress some of an academic bent. There is no mathematical model to piece of work with, in addition to no means to bear witness anything near behaviour. If you lot wanted to develop a mathematical model of the simulation, you lot would genuinely demand to abstract away the simulation details in addition to come upwardly up amongst a reduced cast version of the simulation deportment -- simply similar simulating real-world economies.

This is intentional. If nosotros forcefulness the state information to create got a sure enough form, nosotros are effectively forcing the agents to follow sure enough rules of behaviour. This limits the flexibility of the simulation, in addition to nosotros practise non know whether whatsoever behavioural patterns are the termination of the simplifying assumptions, or agent behaviour. As a classic example, create got the "equilibrium" supposition of mainstream economics. That supposition has locked mainstream models into a theoretical dead end, in addition to makes it extremely hard to relate economical models to actual behaviour.

State of the Simulator

The client-server architecture does non practise a lot at present; it covers the transmission of the organisation fourth dimension equally good equally the mass of telephone commutation gild processing.

Although transmitting the simulation fourth dimension sounds laughably slow to do, at that topographic point are hidden difficulties. The simulator is expected to run inwards real-time mode, amongst clock fourth dimension corresponding to simulation fourth dimension (with an acceleration factor). The clients may locomote running on different machines than the server. Meanwhile, at that topographic point are events that volition locomote associated amongst exceptional simulation times, such equally the halt of a production process. Therefore, the treatment of fourth dimension is trickier than it would locomote inwards a directly mathematical model.

The telephone commutation gild treatment is largely done; I simply wishing to add together a characteristic that prevents agents from trying to sell to a greater extent than of a commodity than they create got inwards inventory. (Buying likewise much is less of an issue; I intend it should locomote possible to create got an automated reaction yesteryear the telephone commutation for dealing amongst over-levered agents.)

The original remaining server components are the production functions equally good equally transportation commodities betwixt exchanges. These should locomote genuinely real straightforward to implement. The production functions volition locomote a laid of possible operations to arrive at commodities using commodity inputs (as discussed farther below).

After that, almost all piece of work would locomote on customer behaviour.

The Blank Slate Problem

When the simulation starts up, at that topographic point are no orders on the exchanges. An agent powerfulness to brand decisions inwards the consummate absence of whatsoever external pricing information. How is supposed to practise that?

This is precisely the same job that bedevils mainstream macroeconomic models. It is possible to pivot downward the relative cost betwixt reward in addition to the i (composite) commodity, but at that topographic point is zero to pivot downward the initial cost level.

One possible approach is to "seed" initial cost information yesteryear making blueprint decisions. It is extremely probable that this volition termination inwards wildly different outcomes depending on the initial seed values. However, nosotros would create got to forcefulness sure enough agents to insert bids in addition to offers into the telephone commutation at initialisation. Those agents powerfulness directly withdraw those orders, leaving the simulation without whatsoever marketplace prices i time again.

Another approach is to locomote neo-Chartalist, in addition to create got the authorities laid at to the lowest degree some initial prices yesteryear making bids at arbitrary prices. The authorities is able in addition to willing to exit those bids inwards place, in addition to thus provides an initial puddle of pricing information that soul agents tin work for decision-making.

(The labour marketplace volition locomote aggregated, in addition to reward volition locomote sticky. Once it is implemented, the labour marketplace powerfulness practise a real skillful task of pinning downward an initial cost level.)

Capital is a Commodity

Everything inwards the simulation is a commodity, in addition to traded on markets -- including capital. (This powerfulness brand Sraffians happy.) The objective is to eliminate non-arms length transactions betwixt agents (firms). (The labour in addition to retail markets would locomote added later, in addition to human activity inwards an aggregated fashion, in addition to exterior the telephone commutation system.) 

As a side effect, upper-case alphabetic lineament is permanent; it is assumed to locomote maintained to locomote "good equally new" at all times. (It would locomote possible to de-construct upper-case alphabetic lineament goods to furnish raw materials if at that topographic point is a glut of capital; this would locomote some other alternative inwards the bill of fare of production component subdivision choices.)

Otherwise, nosotros would demand to laid prices for used upper-case alphabetic lineament goods (that create got a express life span). The inquiry is why whatsoever line of piece of work solid would offering a non-negligible cost for such goods. The original argue an agent would endeavour selling upper-case alphabetic lineament goods is that they are facing liquidity constraints; why bail them out amongst a reasonable bid for what they are selling?

Who Needs Land, Anyway?

One of the complaints raised yesteryear some heterodox economists is that criterion models ignore land; they wishing land, capital, in addition to labour equally beingness the base of operations factors of production.

The simulation side-steps the number yesteryear having the backstory of beingness laid inwards space. In space, ground is non a factor of production.

The Financial System

The determination to brand everything exchange-based makes the fiscal organisation a lot easier to handle. We simply assume that the exchanges are government-backed, in addition to that agents are allowed to incur margin debt based on the marketplace value of their inventories. The "money" inwards the organisation is the agent's cash residuum at the exchange, which would usually locomote expected to locomote negative (borrowing against inventory, including capital).

Adding a banking organisation poses a groovy many issues. Banking is a non-arm's length business, in addition to it is unclear how to laid it up. One possible organisation is a keiretsu (or chaebol) where banks are embedded inside a grouping of industrial firms. Firms would locomote expected to bargain amongst their captive bank, in addition to the banking concern would also interact amongst the aggregated menage sector next uncomplicated rules.

The architecture of the organisation allows multiple currencies, but that is unlikely to locomote implemented for some time.

Concluding Remarks

After the holidays, I volition in all probability teach dorsum to working on a study on inflation-linked bonds. However, I promise to create got pose together the nub server systems of the agent-based simulator, thus that I tin starting fourth dimension puttering around amongst agent deportment when I am bored.

(c) Brian Romanchuk 2017

No comments