# How to use Weight Windows

**URL:** <https://openmc.discourse.group/t/how-to-use-weight-windows/3730>\
**Category:** User Support\
**Created:** [December 12, 2023, 2:11pm UTC](https://openmc.discourse.group/t/how-to-use-weight-windows/3730 "2023-12-12T14:11:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![longritian](https://avatars.discourse-cdn.com/v4/letter/l/bcef8e/32.png) [@longritian](https://openmc.discourse.group/u/longritian)\
**Post date:** [December 12, 2023, 2:11pm UTC](https://openmc.discourse.group/t/how-to-use-weight-windows/3730/1 "2023-12-12T14:11:23Z")

</div>

Hello everyone,  
These days I want to test the performance of the variance reduction method in OpenMC 0.14.0, I noticed that there are two main python classes: “openmc.WeightWindowGenerator” and “openmc.WeightWindows”, then I can find some examples in neutronics-workshop of fusion energy group, but for the example I can just see the usage of “openmc.WeightWindowGenerator”, then I want to know how to use the “openmc.WeightWindows”? What’s the difference beween it and the “openmc.WeightWindowGenerator”?  
[weight window examples](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_14_variance_reduction)

---

<div class="post-metadata">

**Author:** ![kingyue](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kingyue/32/507_2.png) [@kingyue](https://openmc.discourse.group/u/kingyue)\
**Post date:** [March 5, 2024, 10:38am UTC](https://openmc.discourse.group/t/how-to-use-weight-windows/3730/2 "2024-03-05T10:38:25Z")

</div>

I also have related questions with `openmc.WeightedWindowGenerator`. What’s the function of `max_realizations` and `update_interval`? If I set `max_realizations=5` and `update_interval=2`, does it mean that weighted windows will update every 2 batches and finish at the 10th batch?

---

<div class="post-metadata">

**Author:** ![kingyue](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kingyue/32/507_2.png) [@kingyue](https://openmc.discourse.group/u/kingyue)\
**Post date:** [March 8, 2024, 3:26am UTC](https://openmc.discourse.group/t/how-to-use-weight-windows/3730/3 "2024-03-08T03:26:21Z")

</div>

Shimwell gave a detailed explanation to my question

> **[Task 14: iterative Weight Windows via Python API ·...](https://github.com/fusion-energy/neutronics-workshop/discussions/274#discussioncomment-8706095)**
>
> Firstly, thanks very much for this awesome repo. I couldn't find any example related to the new Weight Windows feature of OpenMC before reaching the repo here. This workshop provides a very complet...
