Skip to content

Commit

Permalink
changing documentation of new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
SiobhanPowell committed May 20, 2022
1 parent e357aab commit bbae008
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This web application was developed by Lesley Ryan with help from Siobhan Powell.


## Code
The main code is presented in `speech.py` and the file `SimpleExample.py` presents a simple example of how to use it.
The main code is presented in `speech.py` and the file `SimpleExample.py` presents a simple example of how to use it. `HowToExtractIndividualSessions.py` gives sample code for accessing the individual simulated sessions behind an aggregate scenario.

The more complex scenarios used in `RunPaperScenarios.py` generate the scenarios included in the publication, "Scalable Probabilistic Estimates of Electric Vehicle Charging Given Observed Driver Behavior".

Expand Down Expand Up @@ -98,9 +98,10 @@ model = SPEECh(data)
config = SPEEChGeneralConfiguration(model)
```

At this stage you have the option to adjust the distribution over driver groups, P(G). As an example, this would adjust the weight of clusters 0 and 1 to cover 50% of drivers each. I.e. P(G=0)=0.5, P(G=1)=0.5. This step is optional.
At this stage you have the option to adjust the distribution over driver groups, P(G). As an example, this would adjust the weight of clusters 0 and 4 to cover 50% of drivers each. I.e. P(G=0)=0.5, P(G=4)=0.5. This step is optional. The flag dend=True should be used when you make your own weights to ensure the group numbers line up with the paper. Also note the group numbering starts at 0 instead of 1 in the code.

```
config.change_pg(new_weights={0: 0.5, 1: 0.5})
config.change_pg(new_weights={0: 0.5, 4: 0.5}, dend=True)
```

Next, tell the configuration class how many drivers to simulate, and call `groups()` to load the group configurations.
Expand All @@ -109,9 +110,9 @@ config.num_evs(total_evs)
config.groups()
```

At this stage you have the option to adjust the distribution over charging session behaviours, P(s|z, G). As an example, this would adjust the distribution for driver group 1 workplace weekday charging, giving 40% weight to the first behaviour component in the mixture model and 60% to the second. This step is optional.
At this stage you have the option to adjust the distribution over charging session behaviours, P(s|z, G). As an example, this would adjust the distribution for driver group 0 workplace weekday charging, giving 40% weight to the first behaviour component in the mixture model and 60% to the second. This step is optional.
```
config.change_ps_zg(1, 'Work', 'weekday', {0: 0.4, 1: 0.6})
config.change_ps_zg(0, 'Work', 'weekday', {0: 0.4, 1: 0.6})
```

Finally, calculate the load profile and plot:
Expand Down
6 changes: 3 additions & 3 deletions SimpleExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Demonstration of changing group weights and behaviour weights:
model = SPEECh(data)
config = SPEEChGeneralConfiguration(model)
config.change_pg(new_weights={3: 0.5, 4: 0.5}, dend=True) # Adjust distribution over driver groups so that 0 and 1 have each 50%
config.change_pg(new_weights={0: 0.5, 4: 0.5}, dend=True) # Adjust distribution over driver groups so that 0 and 4 have each 50%
# Note counting of groups starts at 0 and ends at 15 (subtract 1 from the numbering in the paper)
# (^ down-weights the others to 0 accordingly)

Expand All @@ -40,9 +40,9 @@

config.num_evs(total_evs) # Input number of EVs in simulation
config.groups()
# Give weights 40% and 60% to behaviors 0 and 1 in the group 1 workplace segment:
# Give weights 40% and 60% to behaviors 0 and 1 in the group 0 workplace segment:
# (down-weights the others to 0 accordingly)
config.change_ps_zg(3, 'Work', 'weekday', {0: 0.4, 1: 0.6})
config.change_ps_zg(0, 'Work', 'weekday', {0: 0.4, 1: 0.6})
config.run_all(weekday=weekday_option)
plots = Plotting(model, config)
plots.total(save_str='simple_example_plot_adjusted.png')

0 comments on commit bbae008

Please sign in to comment.