<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EvoNet.Controls;
using Graph;
using EvoNet.Map;

namespace EvoNet.Forms
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            foodValueList.Color = Color.Green;
            FoodGraph.Add("Food", foodValueList);

            evoSimControl1.OnUpdate += EvoSimControl1_OnUpdate;

        }

        private void EvoSimControl1_OnUpdate(Microsoft.Xna.Framework.GameTime obj)
        {

        }

        GraphValueList foodValueList = new GraphValueList();
        int lastFoodIndex = 0;

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Close();

        }

        private TileMap TileMap
        {
            get
            {
                return evoSimControl1.sim.TileMap;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            float Value = TileMap.FoodRecord.Skip(lastFoodIndex).Average();
            lastFoodIndex = TileMap.FoodRecord.Count;
            foodValueList.Add(new GraphTimeDoubleValue(DateTime.Now, Value));
            FoodGraph.Refresh();
        }
    }
}<commit_msg>Check for empty array on food record<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EvoNet.Controls;
using Graph;
using EvoNet.Map;

namespace EvoNet.Forms
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            foodValueList.Color = Color.Green;
            FoodGraph.Add("Food", foodValueList);

            evoSimControl1.OnUpdate += EvoSimControl1_OnUpdate;

        }

        private void EvoSimControl1_OnUpdate(Microsoft.Xna.Framework.GameTime obj)
        {

        }

        GraphValueList foodValueList = new GraphValueList();
        int lastFoodIndex = 0;

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Close();

        }

        private TileMap TileMap
        {
            get
            {
                return evoSimControl1.sim.TileMap;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (TileMap.FoodRecord.Count > lastFoodIndex)
            {
                float Value = TileMap.FoodRecord.Skip(lastFoodIndex).Average();
                lastFoodIndex = TileMap.FoodRecord.Count;
                foodValueList.Add(new GraphTimeDoubleValue(DateTime.Now, Value));
                FoodGraph.Refresh();
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08042076688157448, 'fraction_numerical': 0.004750593824228029, 'mean_word_length': 2.042311661506708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3676485', 'n_tokens_mistral': 831, 'n_tokens_neox': 793, 'n_words': 167}