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

📄 firm.m

📁 仿真人工金融市场Jackson代码
💻 M
字号:
#import "Firm.h"@implementation Firm-createEnd {//yMonopList=[List create:[self getZone]];  return self;}	-setInitialConditions {  // Initial conditions  lastMonop = ((alpha - fixedCost)/(variableCost + 2 * beta));  LM1 = lastMonop;  lastCFactor = 0.0;transmitD = 0.0;myQuantity = 0;// inizializziamo la listareturn self;}-setAlpha: (double) a {  alpha=a;  return self;}-setBeta: (double) b {  beta=b;  return self;}-(double)getMyQuantity {double res;res = (alpha - fixedCost)/(variableCost +(2*beta));myQuantity = res;return res;}// prezzo in regime di assenza del contraffattore-(double)getMyPrice {double res;res = alpha - beta * myQuantity;//printf (" my price ---> %f \n", res);return res;}//quantita' prodotta dal monopolista al tempo t-(double)getQuantityMonop {double production;double noto;double coeff1;double coeff2;double kappa;double effe;double lastCF;lastCF = [[modelswarm getCFactor] getLastCF]; effe = [[modelswarm getCFactor] getFF];//effe = [market geteffe];kappa = [[modelswarm getMarket] getK];noto = ((alpha - fixedCost) /(variableCost+2*beta));coeff1 =  (beta*beta *effe)/((variableCost+2*beta)* (variableCost+beta));coeff2 = (reputationInvestment*(kappa-1))/(variableCost+2*beta);production = noto -coeff1*lastMonop + coeff2*lastCF;if (production <=0) {	production=0;//	transmitD = 0;	} //else//	{	transmitD = reputationInvestment;//	}quantityMonop = production; return production;}-(double) getMonop {return quantityMonop;}-(double)getLastMonop {return LM1;}-(double) getFixedCost {return fixedCost;}-step {double al;if ([modelswarm getTime]==0)  {     reputationInvestment = 0;  } else {   if ([modelswarm getChoiceD]!=0)  {   reputationInvestment=[self dynamicIR];//printf ("dynIr dinamico  %f \n", reputationInvestment);   } else {     reputationInvestment = [modelswarm getMarketD];    //printf ("dynIr costante  %f \n", reputationInvestment);      }   }LM1 = lastMonop;al = [self getQuantityMonop];lastMonop = al;  return self;}-setValC: (double) valc { fixedCost = valc; return self;}-setValC1: (double) valc1 { variableCost = valc1; return self;}-(double) getVariableCost {  return variableCost;}-setF: (double) valff {ef = valff;return self;}-setValD: (double) valdi {  reputationInvestment = valdi;originalD = valdi; return self;}-(double) getValD {return transmitD;}//investimento in reputazione nella versione dinamica -(double)dynamicIR {double temp;double num, den;double hisLastCF=0;hisLastCF = [[modelswarm getCFactor] getLastCF];//printf (" hislastCF   %f10 \n", hisLastCF);if (hisLastCF ==0) hisLastCF=1E-9;//printf (" hislastCF   %f10 \n", hisLastCF);num = beta * [[modelswarm getCFactor] getLastCF] - alpha +fixedCost;den = ([[modelswarm getMarket] getOldKappa] - 1) * hisLastCF;temp = num/den;if (temp <= 0)  temp = 1E-9;return temp;}-setModel: (id) mo {  modelswarm = mo;  return self;}@end  

⌨️ 快捷键说明

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