CourseWorkKnapsack/classes/KnapsackState.cs
2024-05-29 02:26:53 +04:00

27 lines
751 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static ProjectKnapsack.classes.KnapsackParameters;
namespace ProjectKnapsack.classes;
public class KnapsackState
{
public List<Item> Items { get; }
public double CurrentWeight { get; }
public double CurrentValue { get; }
public int CurrentIndex { get; }
public int Capacity { get; set; }
public KnapsackState(List<Item> items, double currentWeight, double currentValue, int currentIndex, int capacity)
{
Items = new List<Item>(items);
CurrentWeight = currentWeight;
CurrentValue = currentValue;
CurrentIndex = currentIndex;
Capacity = capacity;
}
}