I need a algorithm or function in C# that plans and creates tasks with the least number of trucks based on these rules:
1. Each truck can take either a container of size 40 or two containers 20.
2. A task or a job is about a truck drop of one or more containers (based on capacity rule 1 ) and pickup one or more containers
The following are the classes.
public class TaskInfo
{
public TruckInfo Truck { get; set; }
public List<ContainerInfo> Pickup { get; set; }
public List<ContainerInfo> DropOff { get; set; }
}
public class TruckInfo
{
public var PlateNo { get; set; }
}
public class ContainerInfo
{
public string ContainerNo { get; set; }
public string ContainerSize { get; set; }
}
Using this below test data, I need winner to create a function (createtasks) that takes a list of containers to drop-off and pickup and then comes up with the best plan (by creating tasks hence ) which allows the use of the least number of trucks.
List<ContainerInfo> PickupContainers = new List<ContainerInfo>();
List<ContainerInfo> dropoffcontainers = new List<ContainerInfo>();
ContainerInfo pc1 = new ContainerInfo();
[login to view URL] = "BMOU4364018";
[login to view URL] = "20";
ContainerInfo pc2 = new ContainerInfo();
[login to view URL] = "PCIU8986471";
[login to view URL] = "20";
ContainerInfo pc3 = new ContainerInfo();
[login to view URL] = "PCIU1905035";
[login to view URL] = "20";
ContainerInfo pc4 = new ContainerInfo();
[login to view URL] = "PCIU1905035";
[login to view URL] = "40";
[login to view URL](pc1);
[login to view URL](pc2);
[login to view URL](pc3);
[login to view URL](pc4);
ContainerInfo drop_con1 = new ContainerInfo();
[login to view URL] = "MTY0000240";
[login to view URL] = "20";
ContainerInfo drop_con2 = new ContainerInfo();
[login to view URL] = "MTY0000241";
[login to view URL] = "40";
ContainerInfo drop_con3 = new ContainerInfo();
[login to view URL] = "MTY0000242";
[login to view URL] = "40";
[login to view URL](drop_con1);
[login to view URL](drop_con2);
[login to view URL](drop_con3);
List<TaskInfo> tasks = new List<TaskInfo>();
createtasks(PickupContainers, dropoffcontainers, tasks);
Thank you for your posting job.
I read your project description and I'm very interested in this project.
As you can see via my profile, I have expertise skills to build C#& C++.
If you hire me for this project, you will have a chance to get to know another talent and trustworthy.
I hope to work with you, sincerely.
Hello, I have read your specifications and I think I understand the requirement correctly.
Just one question: it can be assumed that all the drops and pickups occur at the same location and time right?
If so, I can get this done in the next hour, provided you accept the bid and escrow the project.
Hello, i am Rida ayesha i have around 5 years if experience in development, C# ,c++ are my cores. You can also check my review about programming.
Jo just come in message box so we can discuss this problem and i will start working for you soon.
I will deliver the optimal solution to your problem. I will actually start working on the project right away as I love these kind of algorithmic problems. I look forward to working with you.