Next_Block<-function(Index_Vehicle=1,Current_Time=0,Block_Index=1){
Remaining_G<-RG[Block_Index]
Remaining_C<-RC[Index_Vehicle]
Remaining_Time<-WH-CT
if(Remaing_G>Remainng_C){
Clean_UP_Time # Generate time to clean up Remaining_C
if(**Remaining_Time<Clean_Up_Time**){
Trash_Collected<-Remaining_Time/Clean_Up_Time*RC[Index_Vehicle]
***RC[Index_Vehicle]=RC[Index_Vehicle]-Trash_Collected***
*** RG[Block_Index]=RG[Block_Index]-Trash_Collected***
CT=7.5
# Go to landfill
# This vehicle next event time -> Inf
Next_block_Arraval_Time[Index_Vehicle]=Inf
Why is using twice the same variable , because RemainingG = RG, why not just used RG Y RC for everything .