Skip to content

updated tclp test#15

Open
purboday wants to merge 2 commits intointegrate-regulator-and-landfill-agentsfrom
tclp-test-modeling
Open

updated tclp test#15
purboday wants to merge 2 commits intointegrate-regulator-and-landfill-agentsfrom
tclp-test-modeling

Conversation

@purboday
Copy link
Collaborator

@purboday purboday commented Oct 24, 2025

ABM_CE_PV_Model.py

  • Added new model parameters tclp_params for both “fresh” and “aged” modules (mean, std)
  • Introduced age-dependent parameterization for hazard testing, allowing module hazard probability to vary smoothly with age. Implemented logistic interpolation between fresh and aged parameters.
  • Updated the hazard classification rule to use a Weibull distribution, with a configurable threshold.

test_model.py

  • Added new unit tests to validate the updated TCLP hazard logic. Tests cover age-dependent hazard classification and ensure correct behavior for both fresh and aged module scenarios.

@purboday purboday requested a review from jwalzberg November 18, 2025 17:38
"""

return random.gauss(0, 1) > 0.5 # Placeholder for actual logic
module_age_years = self.current_date.year - start_year
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purboday how is start_year determined? I imagine module_age_year should be dependent on the installation year rather than a fixed start_year? Some module have been installed prior to 2020 and some module will be installed after 2020? Is the code accounting for that by letting start_year be an input to this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is the idea that when this function is called the installation year would be passed as an argument. But I was not able to find a way to trace the origin of the waste produced and its installation date so for now this input is not really useful.

Copy link
Collaborator

@jwalzberg jwalzberg Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we could do is having a new agent variable self.installation_year that is initialized with the USPVDB p_year column. Then we could have a function that is more or less like that:

def update_install_year():
       # When reaching installation end-of-life, agent install new PV panels 
       if self.installation_year + self.model.product_lifetime == self.model.current_date.year:
                self.installation_year = self.current_date.year

In the consummer agent step function we can add this new function.

Copy link
Collaborator

@jwalzberg jwalzberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purboday looks all good to me, thanks for your hard work! I am just wondering about start_year but I am sure it is not fixed at 2020. Will look at the code more extensively to see what is fed to the tclp method for the start_year.

@jwalzberg
Copy link
Collaborator

@purboday looks all good to me, thanks for your hard work! I am just wondering about start_year but I am sure it is not fixed at 2020. Will look at the code more extensively to see what is fed to the tclp method for the start_year.

Actually... It seems that nothing is passed to the tclp_test method:

else: # If the TCLP test is applicable, check if the waste is hazardous # based on the TCLP test results. self.hazardous = self.model.tclp_test()

We need to find a way to pass installation year of waste. Let's discuss...

@purboday
Copy link
Collaborator Author

purboday commented Dec 3, 2025

@purboday looks all good to me, thanks for your hard work! I am just wondering about start_year but I am sure it is not fixed at 2020. Will look at the code more extensively to see what is fed to the tclp method for the start_year.

Actually... It seems that nothing is passed to the tclp_test method:

else: # If the TCLP test is applicable, check if the waste is hazardous # based on the TCLP test results. self.hazardous = self.model.tclp_test()

We need to find a way to pass installation year of waste. Let's discuss...

Yes you are right @jwalzberg . I thought about it and there could be two options we can take:

  1. Define some sort of probability distribution to estimate the installation year.
  2. Just go with a static mean and sd considering all modules to belong to the "field aged" category.

Let's revisit this after the paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Probability distribution for RCRA 8 metals concentration in TCLP test

2 participants