예제 #1
0
        public void Optimize()
        {
            Data.LoadData();

            do
            {
                Master master = new Master();
                master.Frmk = this;
                if (!master.Solve())
                {
                    throw new ApplicationException("主问题不可行!");
                }

                Slave slave = new Slave();
                slave.Frmk = this;
                if (!slave.Solve())
                {
                    throw new ApplicationException("子问题出错!");
                }

                if (Math.Abs(master.ObjValue - slave.ObjValue) < 0.001)
                {
                    master.Dispose();
                    slave.Dispose();
                    break;
                }
                master.Dispose();
                slave.Dispose();
            }while (true);
        }
예제 #2
0
        public void Dispose()
        {
            _logger.Dispose();

            Fixture.Driver.EraseRoomAsync(RoomId).Wait();

            Fixture.Dispose();
            Master.Dispose();
            Slave.Dispose();
        }
예제 #3
0
        public void Dispose()
        {
            Master?.Dispose();

            Slave?.Dispose();

            if (Jamod != null)
            {
                Jamod.Kill();
                Thread.Sleep(4000);
            }
        }
예제 #4
0
        private bool disposedValue = false; // To detect redundant calls

        /* protected virtual */             // if not sealed!
        void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    Master.Dispose();
                    Slave.Dispose();
                    Output.Dispose();
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }