public void Initialize(int memSize) { MemorySize = memSize; for (int i = 0; i < MemorySize; i++) { Memory.Add(new MemoryBlock() { ProcessId = 0, IsAssigned = false, IsEnd = false, IsStart = false }); } MemoryInitEventArgs arg = new MemoryInitEventArgs { MemoryAlgorithmName = "Best Fit", NumberOfBlocks = MemorySize, Memory = this.Memory }; BlockFit firstblock = new BlockFit(); firstblock.start_pos = 0; firstblock.ID = 0; firstblock.blockLength = MemorySize; avail.Add(firstblock); OnInitialize(arg); }
public void Initialize(int memSize) { MemorySize = memSize; for (int i = 0; i < MemorySize; i++) { Memory.Add(new MemoryBlock() { ProcessId = 0, IsAssigned = false, IsEnd = false, IsStart = false }); } MemoryInitEventArgs arg = new MemoryInitEventArgs { MemoryAlgorithmName = "First Fit", NumberOfBlocks = MemorySize, Memory = this.Memory }; OnInitialize(arg); }