コード例 #1
0
ファイル: CTabuSearch.cs プロジェクト: andrehalley6/jobshop
        public int HitNilaiEvaluasi(int idx, int jml_mesin, int[][] wkt_proses, int[] ready_time)
        {
            CDecoding Jadwal = new CDecoding(jml_mesin);

            evaluation[idx] = 0;

            List <string> A = Jadwal.SetHimpunan_A(candidate[idx]);

            Jadwal.SortHimpunan_A(A);

            List <int> t = new List <int>();

            for (int i = 0; i < ready_time.Length; i++)
            {
                t.Add(ready_time[i]);
            }

            for (int i = 0; i < candidate[idx].Length; i++)
            {
                for (int j = 0; j < candidate[idx][i].Count; j++)
                {
                    int           index = Jadwal.CekTime_t(t, candidate[idx], A);
                    int           mesin = Jadwal.NoMesin_M(candidate[idx], A, index);
                    List <string> B     = Jadwal.SetHimpunan_B(candidate[idx], A, index, mesin, t);

                    t = Jadwal.UpdateTime_t(t, A, index, mesin, wkt_proses, candidate[idx]);
                    A = Jadwal.UpdateHimpunan_A(A, index, candidate[idx]);
                }
            }

            return(evaluation[idx] = Jadwal.GetMakespan(ready_time));
        }
コード例 #2
0
        public int HitFitness(int jml_mesin, int no_kromosom, int[][] wkt_proses, int[] ready_time)
        {
            CDecoding Jadwal = new CDecoding(jml_mesin);

            fitness = 0;

            List <string> A = Jadwal.SetHimpunan_A(kromosom[no_kromosom]);

            Jadwal.SortHimpunan_A(A);

            List <int> t = new List <int>();

            for (int i = 0; i < ready_time.Length; i++)
            {
                t.Add(ready_time[i]);
            }

            for (int i = 0; i < kromosom[no_kromosom].Length; i++)
            {
                for (int j = 0; j < kromosom[no_kromosom][i].Count; j++)
                {
                    int           index = Jadwal.CekTime_t(t, kromosom[no_kromosom], A);
                    int           mesin = Jadwal.NoMesin_M(kromosom[no_kromosom], A, index);
                    List <string> B     = Jadwal.SetHimpunan_B(kromosom[no_kromosom], A, index, mesin, t);

                    t = Jadwal.UpdateTime_t(t, A, index, mesin, wkt_proses, kromosom[no_kromosom]);
                    A = Jadwal.UpdateHimpunan_A(A, index, kromosom[no_kromosom]);
                }
            }
            fitness = Jadwal.GetMakespan(ready_time);

            return(fitness);
        }
コード例 #3
0
        public int Makespan(List <string>[] kromosom, int jml_job, int jml_mesin)
        {
            CDecoding     Jadwal = new CDecoding(jml_mesin);
            List <string> A      = Jadwal.SetHimpunan_A(kromosom);

            Jadwal.SortHimpunan_A(A);

            List <int> t = new List <int>();

            for (int i = 0; i < ready_time.Length; i++)
            {
                t.Add(ready_time[i]);
            }

            for (int i = 0; i < kromosom.Length; i++)
            {
                for (int j = 0; j < kromosom[i].Count; j++)
                {
                    int           index   = Jadwal.CekTime_t(t, kromosom, A);
                    int           mesin   = Jadwal.NoMesin_M(kromosom, A, index);
                    List <string> UpdateB = Jadwal.SetHimpunan_B(kromosom, A, index, mesin, t);

                    t = Jadwal.UpdateTime_t(t, A, index, mesin, waktu_proses, kromosom);
                    A = Jadwal.UpdateHimpunan_A(A, index, kromosom);
                }
            }

            return(Jadwal.GetMakespan(ready_time));
        }