⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mktmodelswarm.h

📁 仿真人工金融市场Jackson代码
💻 H
字号:
// Tim Jares -- MktModelSwarm.h//   This is a modification of the Swarm template.// // For now, the mktMaker will be subsumed in the mktModelSwarm.// Eventually, it may make more sense to implement it as a subswarm.//#import <analysis.h>#import <simtools.h>#import <simtoolsgui.h>#import <objectbase/Swarm.h>#import <objectbase.h>#import <stdlib.h>#import "Define.h"#import "Trader.h"#import "MktMaker.h"#import "MktStats.h"#import "Reporter.h"// MktModelSwarm - This info is that which is necessary for the mkt// maker to track the risky and riskless assets, and the market// participants over time.@interface MktModelSwarm : Swarm {  // MODIFY: add your own simulation parameters  int    riskySupply;           // supply of risky asset  int    riskLessSupply;        // supply of riskless asset  // specialist's inventory  double riskyInventory;	  double riskLessInventory;  int	 numFundTraders;        // number of fund traders to start with  int	 numNoiseTraders;       // number of noise traders to start with  int	 numTraders;            // number of traders overall   int	 numClasses;            // number of trader classes overall   double riskyEndow;		// number of initial risky shares/each  double riskLessEndow;		// number of init riskless units/each  double riskyClearPrice;       // current period mkt clearing                                //   price for risky asset  double riskyVol;		// number of shares changing hands in period  double riskLessClearPrice;    // current clearing price for riskless  double riskLessRate;		// riskless coupon rate  double risky1LagPrice;        // last period risky price  double riskLess1LagPrice;     // last period riskless price  double riskyCF;               // current periodic risky cash flow  double riskyGrowthRate;       // TRUE growth rate of risky dividend  double riskyNoiseMean;        // mean of noise in growth rate  double riskyNoiseVar;         // var of noise in growth rate  double riskLessCF;            // coupon pmt from riskless asset  float  shortMarginFactor;     // limit short selling as % of wealth  float  longMarginFactor;      // limit buying on margin as % of wealth  float  pauperFactor;          // poor people aren't allowed to trade                                //   until they re-accumulate some wealth  long int	 randomNumSeed;		// seed for number generator  double liqMean;		// mean of liquidity needs for traders  double liqVar;		// var of liq. needs  // MODIFY: add your own model objects.    id modelActions;  id modelSchedule;  id     traderList;            // List of mkt participants  id	 classList;		// List of trader classes  // lists for compiling statistics  id     bankruptList;  id     nvrBankruptList;  id mktMaker;  id mktStats;  id reporter;  id <Histogram> useHisto;  id    wealthAvg;  id    bRWealthAvg;  id    nvrBRWealthAvg;  id  <Graph>  	wealthGraph;  id  <GraphElement>	traderElement, BHElement, EMHFElement,			UEMHFElement, BullElement, BearElement,			TChaserElement;  id  <ActiveGraph>	traderGrapher, BHGrapher, EMHFGrapher,			UEMHFGrapher, BullGrapher, BearGrapher,			TChaserGrapher;  int diagLevel;		// for debugging convenience and for				//   time-series tracking, etc.}// MODIFY: add access methods for what agents are visible.+createBegin: (id) aZone;-createEnd;-buildObjects;-buildActions;-activateIn: (id) swarmContext;-(double) getRiskyPrice;-(double) getRiskyVol;-(double) getRiskyCF;-(double) getRiskyCFNoiseLag;-(double) getFundPrice;-dumpStatistics;-updateHisto;-(double) getBHWealth;-(double) getEMHFWealth;-(double) getUEMHFWealth;-(double) getBullWealth;-(double) getBearWealth;-(double) getTChaserWealth;-(double) getIndClassWealth: (char *) s;-(double) getTotalWealth;-(double) getTotalWealthPercent;-(long int) getRNGSeed;@end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -