Ejemplo n.º 1
0
        public bool IsBetter(GraphEnvironment other)
        {
            if (other == null)
            {
                return(false);
            }

            var fValue = this.AccumulatedProfit;
            var sValue = other.AccumulatedProfit;

            return(fValue > sValue);
        }
Ejemplo n.º 2
0
        public GraphEnvironment Clone()
        {
            var result = new GraphEnvironment();

            result.AccumulatedProfit = this.AccumulatedProfit;
            result.MinimumDemand     = this.MinimumDemand;
            result.Graph             = this.Graph.Clone();

            var auxTrucks = new List <Truck>();

            foreach (var truck in this.Trucks)
            {
                auxTrucks.Add(truck.Clone());
            }

            result.Trucks = auxTrucks;

            return(result);
        }