using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EvoBoat.EvoAlg.Perm
{
    public class PermSolution : VecSolution<PermVector, int>
    {
        public PermSolution()
        { }

        public PermSolution(PermVector content)
        {
            this.Content = content;
        }

        public int CompareTo(PermSolution sol)
        {
            return this.Fit.CompareTo(sol.Fit);
        }

        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
                return true;
            PermSolution sol = obj as PermSolution;
            if (sol == null)
                return false;
            return this.Content.Equals(sol.Content);
        }

        public override int GetHashCode()
        {
            return Content.GetHashCode();
        }

        public override string ToString()
        {
            return Content.ToString() + string.Format("{0:F3}", this.Fit);
        }
    }
}
