Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard-coding of arrivals data file from Scenario #19

Open
TomMonks opened this issue May 24, 2024 · 0 comments
Open

Remove hard-coding of arrivals data file from Scenario #19

TomMonks opened this issue May 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@TomMonks
Copy link
Member

At the moment Scenario has the following logic to initialise time dependent arrivals sampling:

class Scenario:
    
   # Other methods definitions

    def init_nspp(self):
        
        # read arrival profile
        self.arrivals = pd.read_csv(NSPP_PATH)
        self.arrivals['mean_iat'] = 60 / self.arrivals['arrival_rate']
       
        # maximum arrival rate (smallest time between arrivals)
        self.lambda_max = self.arrivals['arrival_rate'].max()
        
        # thinning exponential
        self.arrival_dist = Exponential(60.0 / self.lambda_max,
                                        random_seed=self.seeds[8])
        
        # thinning uniform rng
        self.thinning_rng = Uniform(low=0.0, high=1.0, 
                                    random_seed=self.seeds[9])

The constant NSPP links to the data file containing the arrival profile. This limits experimentation and testing. A solution is to rewrite the function to use a member attribute of the class e.g. self.nspp_path that is set during __init__ where NSPP is the default value.

@TomMonks TomMonks added the enhancement New feature or request label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant