예제 #1
0
        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);
        }
예제 #2
0
        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);
        }