<commit_before>/*******************************************************************************
  * Copyright (C) 2015 AgGateway and ADAPT Contributors
  * Copyright (C) 2015 Deere and Company
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html <http://www.eclipse.org/legal/epl-v10.html> 
  *
  * Contributors:
  *    <NAME>, <NAME> - initial API and implementation
  *    <NAME> Making Properties
  *    <NAME> - added parameters to GetAppliedLatency
  *******************************************************************************/

using System;
using System.Collections.Generic;
using AgGateway.ADAPT.ApplicationDataModel.Representations;
using AgGateway.ADAPT.ApplicationDataModel.Shapes;

namespace AgGateway.ADAPT.ApplicationDataModel.LoggedData
{
    public class SpatialRecord
    {
        private readonly Dictionary<int, RepresentationValue> _meterValues; 
        private readonly Dictionary<int, int?> _appliedLatencyValues;

        public SpatialRecord()
        {
            _meterValues = new Dictionary<Int32, RepresentationValue>();
            _appliedLatencyValues = new Dictionary<Int32,Int32?>();
        }

        public SpatialRecord(int numberOfMeters)
        {
            _meterValues = new Dictionary<Int32,RepresentationValue>(numberOfMeters);
            _appliedLatencyValues = new Dictionary<Int32,Int32?>();
        }

        public Shape Geometry { get; set; }

        public DateTime Timestamp { get; set; }

        public void SetMeterValue(WorkingData workingData, RepresentationValue value)
        {
            _meterValues.Add(workingData.Id.ReferenceId, value);
        }

        public RepresentationValue GetMeterValue(WorkingData workingData)<commit_msg>Comment, since the purpose of the ctor overload may be non-obvious<commit_after>/*******************************************************************************
  * Copyright (C) 2015 AgGateway and ADAPT Contributors
  * Copyright (C) 2015 Deere and Company
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html <http://www.eclipse.org/legal/epl-v10.html> 
  *
  * Contributors:
  *    <NAME>, <NAME> - initial API and implementation
  *    <NAME>
  *    <NAME> - added parameters to GetAppliedLatency
  *******************************************************************************/

using System;
using System.Collections.Generic;
using AgGateway.ADAPT.ApplicationDataModel.Representations;
using AgGateway.ADAPT.ApplicationDataModel.Shapes;

namespace AgGateway.ADAPT.ApplicationDataModel.LoggedData
{
    public class SpatialRecord
    {
        private readonly Dictionary<int, RepresentationValue> _meterValues; 
        private readonly Dictionary<int, int?> _appliedLatencyValues;

        public SpatialRecord()
        {
            _meterValues = new Dictionary<Int32, RepresentationValue>();
            _appliedLatencyValues = new Dictionary<Int32,Int32?>();
        }

        // This overload offers a small performance improvement by avoiding dictionary resizing when calling SetMeterValue.
        public SpatialRecord(int numberOfMeters)
        {
            _meterValues = new Dictionary<Int32,RepresentationValue>(numberOfMeters);
            _appliedLatencyValues = new Dictionary<Int32,Int32?>();
        }

        public Shape Geometry { get; set; }

        public DateTime Timestamp { get; set; }

        public void SetMeterValue(WorkingData workingData, RepresentationValue value)
        {
            _meterValues.Add(workingData.Id.ReferenceId, value);
        }

        public RepresentationValue GetMeterValue(WorkingData workingData)
{'fraction_non_alphanumeric': 0.15169811320754717, 'fraction_numerical': 0.013081761006289308, 'mean_word_length': 3.634032634032634, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2752853', 'n_tokens_mistral': 1068, 'n_tokens_neox': 974, 'n_words': 267}