2024-05-20 02:52:44 +04:00
|
|
|
|
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; }
|
2024-05-29 02:26:53 +04:00
|
|
|
|
public int Capacity { get; set; }
|
2024-05-20 02:52:44 +04:00
|
|
|
|
|
|
|
|
|
public KnapsackState(List<Item> items, double currentWeight, double currentValue, int currentIndex, int capacity)
|
|
|
|
|
{
|
|
|
|
|
Items = new List<Item>(items);
|
|
|
|
|
CurrentWeight = currentWeight;
|
|
|
|
|
CurrentValue = currentValue;
|
|
|
|
|
CurrentIndex = currentIndex;
|
2024-05-29 02:26:53 +04:00
|
|
|
|
Capacity = capacity;
|
2024-05-20 02:52:44 +04:00
|
|
|
|
}
|
|
|
|
|
}
|