User Tools

Site Tools


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

This is an old revision of the document!


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 fit 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?..”)

–to be completed

Industry

lkjòlkj

/var/www/cadia.ru.is/wiki/data/attic/public/i-700-abms-08-1/simulation_version_1.1204823827.txt.gz · Last modified: 2024/04/29 13:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki