public static List<Adolescent> AdolescentList(CoreAMS.Enums.HealthState healthState, int count, string locationProbabilitiesFile) { List<Adolescent> adolescents = new List<Adolescent>(); for (int i = 0; i < count; ++i) adolescents.Add(new Adolescent(GlobalAgentDescriptorTable.GetNewId, healthState, locationProbabilitiesFile)); return adolescents; }
public static List <Child> ChildList(CoreAMS.Enums.HealthState healthState, int count, string locationProbabilitiesFile) { List <Child> childrens = new List <Child>(); for (int i = 0; i < count; ++i) { childrens.Add(new Child(GlobalAgentDescriptorTable.GetNewId, healthState, locationProbabilitiesFile)); } return(childrens); }
public static List <Youngster> YoungsterList(CoreAMS.Enums.HealthState healthState, int count, string locationProbabilitiesFile) { List <Youngster> youngsters = new List <Youngster>(); for (int i = 0; i < count; ++i) { youngsters.Add(new Youngster(GlobalAgentDescriptorTable.GetNewId, healthState, locationProbabilitiesFile)); } return(youngsters); }
public Child(int Id, CoreAMS.Enums.HealthState healthState, string locationProbabilitiesDir) : base(Id, healthState, locationProbabilitiesDir + "/LPChild.csv") { //int st = 10; //int et = 13; //Hospital h1 = new Hospital(0.6, 1000.0); //var key = new LocationProbabilitiesKey() { // startTime = st, // endTime = et, // container = h1 //}; //double pr = locationProbabilities[key]; }
private int infectedOtherAgentTime = 1; // частота заражения других людей (например, заражать кого-либо каждый час) // создаётся агент, которому задаются ID, состояние здоровья public Person(int Id, CoreAMS.Enums.HealthState healthState, string locationProbabilitiesFile) { this.Id = Id; this.healthState = healthState; this.state = Enums.AgentState.Stop; // в зависимости от начального состояния агента мы устанавливаем время, когда агент // перейдет в следующее состояние switch (healthState) { case Enums.HealthState.Infectious: changeTime = infectiousTime; break; case Enums.HealthState.Exposed: changeTime = exposedTime; break; case Enums.HealthState.Recovered: changeTime = recoveredTime; break; } string[] rowValues = null; string[] rows = File.ReadAllLines(locationProbabilitiesFile); for (int i = 0; i < rows.Length; i++) { if (!String.IsNullOrEmpty(rows[i])) { rowValues = rows[i].Split(','); LocationProbabilitiesKey key = new LocationProbabilitiesKey() { startTime = Int32.Parse(rowValues[0]), endTime = Int32.Parse(rowValues[1]), containerType = (Enums.ContainerType)Int32.Parse(rowValues[2]) }; this.locationProbabilities.Add(key, (double)Decimal.Parse(rowValues[3], CultureInfo.InvariantCulture)); } } }
public Adult(int Id, CoreAMS.Enums.HealthState healthState, string locationProbabilitiesDir) : base(Id, healthState, locationProbabilitiesDir + "/Adult.csv") { }
protected void SetHealthState(CoreAMS.Enums.HealthState healthState) { this.healthState = healthState; }
public Youngster(int Id, CoreAMS.Enums.HealthState healthState, string locationProbabilitiesDir) : base(Id, healthState, locationProbabilitiesDir + "/Youngster.csv") { }