ANYLOGIC传染病代码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Main.java代码package传染病;importjava.sql.Connection;importjava.sql.SQLException;importjava.util.ArrayList;importjava.util.Arrays;importjava.util.Calendar;importjava.util.Collection;importjava.util.Collections;importjava.util.Comparator;importjava.util.Currency;importjava.util.Date;importjava.util.Enumeration;importjava.util.HashMap;importjava.util.HashSet;importjava.util.Hashtable;importjava.util.Iterator;importjava.util.LinkedList;importjava.util.List;importjava.util.ListIterator;importjava.util.Locale;importjava.util.Map;importjava.util.Random;importjava.util.Set;importjava.util.SortedMap;importjava.util.SortedSet;importjava.util.Stack;importjava.util.Timer;importjava.util.TreeMap;importjava.util.TreeSet;importjava.util.Vector;importjava.awt.Color;importjava.awt.Font;importjava.awt.Graphics2D;importjava.awt.geom.AffineTransform;importstaticjava.lang.Math.*;importstaticcom.xj.anylogic.engine.presentation.UtilitiesColor.*;importstaticcom.xj.anylogic.engine.presentation.UtilitiesDrawing.*;importstaticcom.xj.anylogic.engine.HyperArray.*;importcom.xj.anylogic.engine.*;importcom.xj.anylogic.engine.analysis.*;importcom.xj.anylogic.engine.connectivity.*;importcom.xj.anylogic.engine.connectivity.ResultSet;importcom.xj.anylogic.engine.connectivity.Statement;importcom.xj.anylogic.engine.presentation.*;importjava.awt.geom.Arc2D;publicclassMainextendsActiveObject{//参数publicdoubleContactRate;/***返回参数codeContactRate/code的默认值。*i此方法不应该被用户调用/i*/publicdouble_ContactRate_DefaultValue_xjal(){finalMainself=this;return5;}publicvoidset_ContactRate(doubleContactRate){if(ContactRate==this.ContactRate){return;}double_oldValue_xjal=this.ContactRate;this.ContactRate=ContactRate;onChange_ContactRate_xjal(_oldValue_xjal);onChange();}/***CallsOnchangeactionforparameterContactRate.br*Notethat'oldValue'inthatactionwillbeunavailableifthismethodiscalledbyuser*(currentparametervaluewillbepassedas'oldValue').br*Pleasecallcodeset_ContactRate()/codemethodinstead.*/voidonChange_ContactRate(){onChange_ContactRate_xjal(ContactRate);}voidonChange_ContactRate_xjal(doubleoldValue){}publicdoubleInfectivity;/***返回参数codeInfectivity/code的默认值。*i此方法不应该被用户调用/i*/publicdouble_Infectivity_DefaultValue_xjal(){finalMainself=this;return0.05;}publicvoidset_Infectivity(doubleInfectivity){if(Infectivity==this.Infectivity){return;}double_oldValue_xjal=this.Infectivity;this.Infectivity=Infectivity;onChange_Infectivity_xjal(_oldValue_xjal);onChange();}/***CallsOnchangeactionforparameterInfectivity.br*Notethat'oldValue'inthatactionwillbeunavailableifthismethodiscalledbyuser*(currentparametervaluewillbepassedas'oldValue').br*Pleasecallcodeset_Infectivity()/codemethodinstead.*/voidonChange_Infectivity(){onChange_Infectivity_xjal(Infectivity);}voidonChange_Infectivity_xjal(doubleoldValue){}publicdoubleTotalPopulation;/***返回参数codeTotalPopulation/code的默认值。*i此方法不应该被用户调用/i*/publicdouble_TotalPopulation_DefaultValue_xjal(){finalMainself=this;return1000;}publicvoidset_TotalPopulation(doubleTotalPopulation){if(TotalPopulation==this.TotalPopulation){return;}double_oldValue_xjal=this.TotalPopulation;this.TotalPopulation=TotalPopulation;onChange_TotalPopulation_xjal(_oldValue_xjal);onChange();}/***CallsOnchangeactionforparameterTotalPopulation.br*Notethat'oldValue'inthatactionwillbeunavailableifthismethodiscalledbyuser*(currentparametervaluewillbepassedas'oldValue').br*Pleasecallcodeset_TotalPopulation()/codemethodinstead.*/voidonChange_TotalPopulation(){onChange_TotalPopulation_xjal(TotalPopulation);}voidonChange_TotalPopulation_xjal(doubleoldValue){}publicdoubleAverageIllnessDuration;/***返回参数codeAverageIllnessDuration/code的默认值。*i此方法不应该被用户调用/i*/publicdouble_AverageIllnessDuration_DefaultValue_xjal(){finalMainself=this;return15;}publicvoidset_AverageIllnessDuration(doubleAverageIllnessDuration){if(AverageIllnessDuration==this.AverageIllnessDuration){return;}double_oldValue_xjal=this.AverageIllnessDuration;this.AverageIllnessDuration=AverageIllnessDuration;onChange_AverageIllnessDuration_xjal(_oldValue_xjal);onChange();}/***CallsOnchangeactionforparameterAverageIllnessDuration.br*Notethat'oldValue'inthatactionwillbeunavailableifthismethodiscalledbyuser*(currentparametervaluewillbepassedas'oldValue').br*Pleasecallcodeset_AverageIllnessDuration()/codemethodinstead.*/voidonChange_AverageIllnessDuration(){onChange_AverageIllnessDuration_xjal(AverageIllnessDuration);}voidonChange_AverageIllnessDuration_xjal(doubleoldValue){}@OverridepublicvoidsetParametersToDefaultValues(){super.setParametersToDefaultValues();ContactRate=_ContactRate_DefaultValue_xjal();Infectivity=_Infectivity_DefaultValue_xjal();TotalPopulation=_TotalPopulation_DefaultValue_xjal();AverageIllnessDuration=_AverageIllnessDuration_DefaultValue_xjal();}//动态(流/辅助/存)变量publicdoubleInfectionRate;publicdoubleRecoveryRate;publicdoubleSusceptible;publicdoubleInfectious;publicdoubleRecovered;/***写入模型变量到给定数组*/publicvoidgetScalarPhaseVector_xjal(double[]_d,double[]_a){_d[0]=S

1 / 35
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功