AS 2024 SKELETON CODE | Queue Stimulator | AQA Pre-Release

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 15

  • @ILOVEALLAHHHHH
    @ILOVEALLAHHHHH 6 місяців тому +1

    Super helpful!! Can you please make more on covering AQA specification? :)

  • @supyaeshan_
    @supyaeshan_ 6 місяців тому +1

    Hi Humon! Would that be possible for you to provide skeleton program as a whole if you have. Thanks

    • @callmehumon
      @callmehumon  6 місяців тому +1

      Hi Andrea! Can you please drop me an email on callmebleepp@gmail.com

    • @supyaeshan_
      @supyaeshan_ 6 місяців тому +1

      @@callmehumon hi ya! Thank you for getting back to me! I’ll send an email to you 🤍

  • @blck.daxielle
    @blck.daxielle 6 місяців тому +1

    Does the code allow you to add a new till if there are too much buyers we queued as I believe that’s a predicted question for section C

    • @callmehumon
      @callmehumon  6 місяців тому +1

      The code does not automatically add a new till if there are too many buyers queued. The number of tills is fixed at the beginning of the simulation based on the default settings or user input.
      However, this could definitely be a potential enhancement to the code.

  • @superbaji5910
    @superbaji5910 6 місяців тому

  • @hugobrowning2478
    @hugobrowning2478 6 місяців тому

    HI HUMON, what exactly do you think the UpdateCell() method in the symbol puzzle code could be possibly used for and what examples could you give. Im asking this because it feels most likely that it will come up onto the exam.

    • @callmehumon
      @callmehumon  6 місяців тому +1

      Great question! It can be anything really but Here are a few possible purposes and examples for the UpdateCell() method:
      1. Updating the state of a cell after a change: This method could be used to update the internal state of a cell after its symbol has been changed or modified. For example, if a wild card symbol ('W') is placed in a cell, the UpdateCell() method could update the cell's internal state to reflect that it now contains a wild card symbol.
      2. Applying constraints or rules to a cell: The method could enforce certain constraints or rules on a cell, such as ensuring that certain symbols are not allowed to be placed in the cell based on its current state or neighbouring cells. For instance, if a cell is adjacent to a blocked cell ('@'), it may need to be updated to disallow certain symbols.
      3. Triggering events or actions based on cell changes: This method could be used to trigger specific events or actions whenever a cell is updated or modified. For example, if placing a symbol in a cell triggers a chain reaction that affects neighbouring cells, the UpdateCell() method could handle propagating these changes.
      4. Maintaining a history of cell updates: The method could be used to log or maintain a history of changes made to a cell, allowing for easier debugging or tracking of the puzzle's state.

    • @hugobrowning2478
      @hugobrowning2478 6 місяців тому

      @@callmehumon that is very helpful, thank you so much I may ask again if I have any other queries!!!

    • @callmehumon
      @callmehumon  6 місяців тому

      @@hugobrowning2478 U r very welcome to ask :)

  • @kabirsaibog2899
    @kabirsaibog2899 5 місяців тому

    hi humon, can you explain each subroutine in the code?

    • @callmehumon
      @callmehumon  5 місяців тому +2

      Hi Kabir, Please read through the following n let me know if this makes sense (Sorry I m super occupied atm so might not be able to upload a proper video covering it) but please let me know if you have any questions:
      Q_Node Class:
      The "Q_Node" class defines a node for the buyer queue, storing "BuyerID", "WaitingTime", and "ItemsInBasket" for each buyer. This structure is essential for managing the state of buyers within the queue.
      ResetDataStructures:
      The "ResetDataStructures" subroutine initializes the simulation data structures: "Stats" (for tracking various statistics), "Tills" (to manage the state of each till), and "BuyerQ" (the queue of buyers).
      ChangeSettings:
      The `ChangeSettings` subroutine allows the user to modify simulation parameters such as `SimulationTime` and `NoOfTills`. It provides default values and validates user input to ensure it falls within acceptable ranges.
      ReadInSimulationData:
      The `ReadInSimulationData` subroutine reads buyer arrival times and items from the `SimulationData.txt` file, storing this information in the `Data` list for use during the simulation.
      OutputHeading:
      The `OutputHeading` subroutine prints the column headers for the simulation output, detailing the data that will be displayed for each time unit.
      BuyerJoinsQ:
      The `BuyerJoinsQ` subroutine adds a new buyer to the queue, updating the `BuyerQ` list and incrementing the queue length `QLength`.
      BuyerArrives:
      The `BuyerArrives` subroutine manages the arrival of a new buyer, adding them to the queue and printing their arrival details.
      FindFreeTill:
      The `FindFreeTill` subroutine searches for a free till that is not currently serving a buyer and returns the till number if one is found, otherwise returns `-1`.
      ServeBuyer:
      The `ServeBuyer` subroutine serves the buyer at the front of the queue, updates the queue by shifting all remaining buyers forward, clears the last position, and reduces the queue length by one.
      UpdateStats:
      The `UpdateStats` subroutine updates the simulation statistics based on the waiting time of the served buyer, tracking total wait time, maximum wait time, and the number of buyers who did not need to wait.
      CalculateServingTime:
      The `CalculateServingTime` subroutine calculates the serving time for a buyer based on the number of items in their basket and updates the serving time for the specified till.
      IncrementTimeWaiting:
      The `IncrementTimeWaiting` subroutine increments the waiting time for each buyer in the queue by one unit.
      UpdateTills:
      The `UpdateTills` subroutine updates the status of each till, incrementing idle time if the till is not serving and incrementing busy time and decrementing serving time if the till is serving a buyer.
      OutputTillAndQueueStates:
      The `OutputTillAndQueueStates` subroutine outputs the current states of the tills and the queue, showing idle time, busy time, serving time for each till, and listing buyers in the queue along with their waiting times and number of items.
      Serving:
      The `Serving` subroutine manages the process of serving buyers by finding a free till, serving the next buyer in the queue, updating stats, calculating serving time, and updating the waiting time and state of tills. It outputs the current states of tills and queue.
      TillsBusy:
      The `TillsBusy` subroutine checks if any till is still busy serving a buyer, returning `True` if at least one till is busy, otherwise returning `False`.
      OutputStats:
      The `OutputStats` subroutine outputs the final statistics of the simulation, including maximum queue length, maximum waiting time, total number of buyers, average waiting time, average queue length, and the number of buyers who did not need to queue.
      QueueSimulator:
      The `QueueSimulator` subroutine is the main function that initializes variables and data structures, reads simulation data, runs the simulation for the specified time units, handles buyer arrivals and serving, continues processing the queue after the main simulation time, and outputs final statistics.
      And finallyyyy the "Main Execution" block runs the `QueueSimulator` function if the script is executed directly and waits for user input before terminating to allow the user to review the output.
      Well done if you read through the whole😁

    • @kabirsaibog2899
      @kabirsaibog2899 5 місяців тому +1

      @@callmehumon thank you very much that has made even more sense!

  • @ProsperRaheem
    @ProsperRaheem 4 місяці тому

    aint no way AS have prerelaes . thoight it was just alvel