User Tools

Site Tools


public:i-700-abms-08-1:simulation_version_1

Market

Psyclone starts and detains all the informations and parameters about ALL the modules that are going to connect to it. A module starts (either the Market or an Industry) knowing only his “<name>”. The module will get its parameters giving its name to Psyclone. In details the market will get its name (“Double Auction Market”) and its country (for this version just “is”) and will start to listen to the industries.

The main body of the market now is a simple loop that always returns back to listent to the industries, and once a message is received it parse it by getting the type:

  • carbon.quota.buy
  • carbon.quota.sell

An offer from a seller (according to the message content) will be stored into a dynamic array that will contain a list of < name | units | price > for every industry that posted a “sell” message. These industries will be waiting for the “sold” response from the market. They are waiting for someone to catch their offer.

If the Market receives a “buy” message and the “offers” array is not empty it will immediately scan this list to look for an offer that fits this bid:

if offer number N has enough units AND the price is lower than my max price

..that industry will get the carbon quotas it asked for.

If the Market gets a “buy” message but NO offers are in the list then a response will be immediately given. The content will contain the field “bought” set to “No”.

So that industry will go back to calculate its stuff (e.g. “how much is my amount right now? what do I have to do? buy or sell?..”)

Industry

The industry class is a skeleton for all of the industries since all of them have the same formulas. The only difference comes from the psySpec.xml file, which in a way behaves like the Government sending out rules and inital values to both the industries and the market.

The industries can send two kinds of messages:

  • carbon.quota.buy
    • The buy message has units, price and the name of the industry sending it. The price is the maximum price the industry is willing to pay for the units of quota
  • carbon.quota.sell
    • The sell message which has units, price and the name of the industry sending it. The price is the minimum price the industry is willing to sell the units of quota

And they listen to all messages from the market of the form:

  • carbon.quota.response
    • There they are only interested in the messages that have the sentTo with their name in it. Otherwise it gets ignored.

In this first version the industries are able to get the initial values from the psySpec file. They can decide upon if they want to sell or buy carbon quotas.
To make the decision they do this simple calculation: amount = ((capacity * carbonRelease) - ownedQuota)

Where:

  • capacity = the total they can produce (create products)
  • carbonRelease = how much they pollute
  • ownedQuota = is how much they own of carbon quota.
  • At the moment this formula is the whole intelligence in the industries.
/var/www/cadia.ru.is/wiki/data/pages/public/i-700-abms-08-1/simulation_version_1.txt · Last modified: 2024/04/29 13:33 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki