廖井涛
2024-03-04 eae17d27ec56a6b7887f5597335e38ca40273ef4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package ng.Algorithm.Layouts;
import java.sql.Connection;
import java.util.*;
public class LayoutAlgorithm {
    public static class AlgorithmParams{
        public int width;                    
        public int length;
        public int h_interval;
        public int v_interval;
        public String method;            //使用的算法名
        public Object methodParam;        //算法需要的参数对象
        
        public void Fill(AlgorithmParams data){
            this.width=data.width;
            this.length=data.length;
            this.h_interval=data.h_interval;
            this.v_interval=data.v_interval;
        
        }
    }
    
    
    
    public static LayoutResult Compute(AlgorithmParams param,List<Piece>[] allglass){
        if(param.method=="Heuristic"){
            Heuristic heuristic=new Heuristic(); 
            heuristic.SetParam(param);
            return heuristic.compute(allglass);
        }
        return null;
    }    
}