Пример #1
0
        public void WriteEntry(ThoughtEntry entry, HouseholdKey householdKey)
        {
            if (entry.Timestep.ExternalStep < 0 && !_calcParameters.ShowSettlingPeriodTime)
            {
                return;
            }
            if (entry.Person == null)
            {
                throw new DataIntegrityException("Empty Person name found in thoughts log file!");
            }
            var name    = entry.Person.Name;
            var filekey = new Tuple <HouseholdKey, string>(householdKey, name);

            if (!_thoughtsFiles.ContainsKey(filekey))
            {
                MakeNewFile(entry.Person.MakePersonInformation(), householdKey);
            }
            var line = new StringBuilder();

            line.Append(entry.Timestep);
            line.Append(_calcParameters.CSVCharacter);
            DateStampCreator dsc = new DateStampCreator(_calcParameters);

            line.Append(dsc.MakeDateStringFromTimeStep(entry.Timestep, out string weekday));
            line.Append(_calcParameters.CSVCharacter);
            line.Append(weekday).Append(_calcParameters.CSVCharacter);
            line.Append(name).Append(_calcParameters.CSVCharacter);
            line.Append(entry.Thought);
            _thoughtsFiles[filekey].WriteLine(line);
        }
 public void WriteEntry(ThoughtEntry entry, HouseholdKey householdKey)
 {
     Logger.Info(entry.Timestep + ":" + householdKey + ":" + entry.Person + ":" + entry.Thought);
 }