private void SetLockedInterestValue(float newInterestValue) { var key = _lockedInterest; if (CurrentInterests.ContainsKey(key)) { CurrentInterests[key] = newInterestValue; } else { CurrentSocialInterests[key] = newInterestValue; } }
public string ToCSVString(List <InterestCategory> interestCategories) { var csvLine = ""; csvLine += _agent.id + "\t" + SimulationTimeInSeconds + "\t" + Position.x + "\t" + Position.y + "\t" + Position.z + "\t" + _agent.AgentCategory.name + "\t"; var lockedInterest = LockedInterest != null ? LockedInterest.name : "-"; csvLine += lockedInterest + "\t"; foreach (var category in interestCategories) { if (CurrentInterests.ContainsKey(category)) { csvLine += CurrentInterests[category] + "\t"; continue; } if (CurrentSocialInterests.ContainsKey(category)) { csvLine += CurrentSocialInterests[category] + "\t"; continue; } csvLine += "0.0" + "\t"; } csvLine += "\n"; return(csvLine); }
public float GetCurrentInterest(InterestCategory interestCategory) { if (CurrentInterests.ContainsKey(interestCategory)) { return(CurrentInterests[interestCategory]); } if (CurrentSocialInterests.ContainsKey(interestCategory)) { return(CurrentSocialInterests[interestCategory]); } else { return(0f); } }