Comments (9)
wouldn't it be easier if we just did t = self.context.time
instead of messing with the whole dt
variable?
Without it the user can have an intuitive sense of time rather than having to convert the time into other units.
so if the dt
in the simulation is a month (2592000 secs), the equation t
variable would be in months.
def demand_calc(self, time):
"""
Calculate the electrical demand at a given timestep (time).
Parameters
----------
time : int
The timestep that the demand will be calculated at.
Returns
-------
demand : The calculated demand at a given timestep.
"""
t = time
demand = eval(self.demand_eq)
return demand
from d3ploy.
But generally I agree the clarification in the readme is needed
from d3ploy.
We can do that, but you need to ensure that the user puts their equation in with regard to the timestep.
Also, not all growth rates will be in regard to the operational time step of the simulation. For example you might consider your growth rate annually, but the time step of the simulation might be weeks, or months, or even seconds. In which case the demand equation needs to account for these differences.
I suppose this is acceptable, since we're already asking users to understand how to input a equation via eval, so they much have some knowledge of how to write python. I'm just hesitant to put most of the burden on the user, when we could solve the problem on the developer side.
from d3ploy.
So from my understanding, we can move forward in two ways:
- Assume that dt is a month and tell the user that the input in the
demand_eq
assumes that time is in month-long time steps. - Generalize it so that the user can define the time step length of their
demand_eq
.
Option 1 is easier to implement but we lose generality. I personally would be in favor of option 2. Perhaps, we could implement only month-long and year-long time step options (and not provide minute/second options).
Thoughts? @jbae11 @FlanFlanagan
from d3ploy.
I think the best way is option 2 with default month. If @FlanFlanagan agrees, I'll make a PR about it once #40 gets merged.
from d3ploy.
Let's do Option 3:
Make it clear to the user that the demand_eq
should have the same time step length as the dt
that they defined in the simulation control. Default dt
is month-long and so, default demand_eq
will also be a month.
from d3ploy.
Option 3 is my vote.
from d3ploy.
okay, I'll make the PR once #47 is merged.
from d3ploy.
closed with #46
from d3ploy.
Related Issues (20)
- combine demand driven inst and supply driven inst HOT 3
- D3ploy can't divide the production of power into different types of reactors. HOT 3
- D3ploy doesn't record the capacity of the mixer when it has multiple inputs for a commodity HOT 10
- pytest - ImportError: cannot import name 'main' HOT 21
- Buffer Type change HOT 1
- D3ploy is not running FFT properly on numpy 1.16.4 HOT 10
- Add function in tester.py to obtain cumulative difference between demand and supply HOT 1
- Mixer doesn't record the demand of all the input commodities. HOT 1
- constraint commodity capability bug HOT 1
- d3ploy fails to record the capacity of mixers deployed with multiple inputs HOT 2
- D3ploy fails to record the capacity of mixers when they are deployed using the same commodity. HOT 1
- Buffer malfunctioning HOT 6
- D3ploy Doesn't Work HOT 13
- update config.yml file to include all the new tests HOT 3
- calc_demand takes the values of the demand_eq HOT 2
- Some of the methods don't actually use the back_steps HOT 1
- Some of the prediction methods don't have the capability to look forward. HOT 3
- Installed cap should't be used with the back end HOT 3
- Installation Issue HOT 16
- Update Documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3ploy.