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); }
public void Dispose() { _logger.Dispose(); Fixture.Driver.EraseRoomAsync(RoomId).Wait(); Fixture.Dispose(); Master.Dispose(); Slave.Dispose(); }
public void Dispose() { Master?.Dispose(); Slave?.Dispose(); if (Jamod != null) { Jamod.Kill(); Thread.Sleep(4000); } }
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; } }