|
| int | economy_sysSave (xmlTextWriterPtr writer) |
| | Saves what is needed to be saved for economy.
|
| int | economy_sysLoad (xmlNodePtr parent) |
| | Loads player's economy properties from an XML node.
|
| credits_t | economy_getPrice (const Commodity *com, const StarSystem *sys, const Spob *p) |
| | Gets the price of a good on a spob in a system.
|
| credits_t | economy_getPriceAtTime (const Commodity *com, const StarSystem *sys, const Spob *p, ntime_t tme) |
| | Gets the price of a good on a spob in a system.
|
| int | economy_getAverageSpobPrice (const Commodity *com, const Spob *p, credits_t *mean, double *std) |
| | Gets the average price of a good on a spob in a system, using a rolling average over the times the player has landed here.
|
| int | economy_getAveragePrice (const Commodity *com, credits_t *mean, double *std) |
| | Gets the average price of a good as seen by the player (anywhere).
|
| int | economy_init (void) |
| | Initializes the economy.
|
| void | economy_addQueuedUpdate (void) |
| | Increments the queued update counter.
|
| int | economy_execQueued (void) |
| | Calls economy_refresh if an economy update is queued.
|
| int | economy_refresh (void) |
| | Regenerates the economy matrix. Should be used if the universe changes in any permanent way.
|
| int | economy_update (unsigned int dt) |
| | Updates the economy.
|
| void | economy_destroy (void) |
| | Destroys the economy.
|
| static int | economy_calcPrice (Spob *spob, Commodity *commodity, CommodityPrice *commodityPrice) |
| | Used during startup to set price and variation of the economy, depending on spob information.
|
| static void | economy_modifySystemCommodityPrice (StarSystem *sys) |
| | Modifies commodity price based on system characteristics.
|
| static void | economy_smoothCommodityPrice (StarSystem *sys) |
| | Calculates smoothing of commodity price based on neighbouring systems.
|
| static void | economy_calcUpdatedCommodityPrice (StarSystem *sys) |
| | Modifies commodity price based on neighbouring systems.
|
| void | economy_initialiseCommodityPrices (void) |
| | Initialises commodity prices for the sinusoidal economy model.
|
| void | economy_initialiseSingleSystem (StarSystem *sys, Spob *spob) |
| void | economy_averageSeenPrices (const Spob *p) |
| void | economy_averageSeenPricesAtTime (const Spob *p, const ntime_t tupdate) |
| void | economy_clearKnown (void) |
| | Clears all system knowledge.
|
| void | economy_clearSingleSpob (Spob *p) |
| | Clears all economy knowledge of a given spob. Used by the unidiff system.
|
Handles economy stuff.
Economy is handled with Nodal Analysis. Systems are modelled as nodes, jump routes are resistances and production is modelled as node intensity. This is then solved with linear algebra after each time increment.
Definition in file economy.c.