Пример #1
0
    private void SetLockedInterestValue(float newInterestValue)
    {
        var key = _lockedInterest;

        if (CurrentInterests.ContainsKey(key))
        {
            CurrentInterests[key] = newInterestValue;
        }
        else
        {
            CurrentSocialInterests[key] = newInterestValue;
        }
    }
Пример #2
0
    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);
    }
Пример #3
0
 public float GetCurrentInterest(InterestCategory interestCategory)
 {
     if (CurrentInterests.ContainsKey(interestCategory))
     {
         return(CurrentInterests[interestCategory]);
     }
     if (CurrentSocialInterests.ContainsKey(interestCategory))
     {
         return(CurrentSocialInterests[interestCategory]);
     }
     else
     {
         return(0f);
     }
 }