import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
class Job implements Comparable<Job>
{
int t1;
int t2;
int id;
public Job(int id,int t1,int t2)
{
this.id = id;
this.t1 = t1;
this.t2 = t2;
}
public int compareTo(Job o) { // t1 非减排序
if(this.t1<o.t1)
return -1;
else
return 1;
}
}
class Com implements Comparator<Job>
{
public int compare(Job o1, Job o2) {
if(o1.t2<o2.t2)
return 1;
else
return -1;
}
}
public class MachiningOrder {
public static void main(String args[])
{
Job jobs [] = {new Job(1,3,7),new Job(2,8,2),new Job(3,10,6),new Job(4,12,18),new Job(5,6,3),new Job(6,9,10),new Job(7,15,4)};
List<Job> j = Arrays.asList(jobs);
getSequence(j);
}
public static void getSequence(List<Job> jobs)
{
List<Job> N1 = new Ar
动态规划--加工顺序问题
最新推荐文章于 2023-08-19 14:57:30 发布