FLEX-Behavior
What It Does
FLEX-Behavior generates stochastic, behavior-derived energy demand profiles for residential households. Instead of using fixed load profiles, it simulates how occupants spend their time throughout the day and translates those activities into appliance electricity demand, hot water demand, and occupancy patterns.
The model runs in two stages:
Person-level simulation (
gen_person_profiles): For each person type (defined by household role and teleworking status), the model generates multiple sample activity trajectories at 10-minute resolution using a Markov chain. Each trajectory encodes: what activity the person is doing, which technology/appliance they are using, their location (home/away), and the resulting electricity and hot water demand.Household-level aggregation (
gen_household_profiles): For each household type, persons are assembled into a household, their profiles are aggregated, and base loads (lighting, always-on appliances) are added. The result is an hourly time series of appliance electricity demand, hot water demand, and occupancy — ready for use by FLEX-Operation.
The Markov Chain Approach
Activity transitions are modeled as a first-order Markov chain: the probability of switching from one activity to another at each 10-minute step is derived from a Time Use Survey (TUS) — a large-scale diary dataset in which respondents record their activities throughout the day. FLEX preprocesses TUS data (see src/models/behavior/tus_process/) to extract transition probabilities stratified by person type, day type (weekday/weekend), and time of day.
This means the output profiles are stochastic: each model run (with a different random seed) produces a different but statistically consistent trajectory. The default configuration generates 5 sample trajectories per person type and 1 sample household per household type.
Person types
ID |
Description |
|---|---|
1 |
Working adult, full-time employed |
2 |
Working adult, part-time employed |
3 |
Student (age < 20) |
4 |
Retired / unemployed (age 66+) |
Non-working types (3, 4) have special handling: if the Markov chain samples a “working” activity, it is replaced by the most common activity at that time slot from the TUS data.
Teleworking
Each day, the model randomly decides whether a person works from home based on BehaviorParam_TeleworkingProb. This probability varies by teleworking type. Activities with location type “variable” (e.g., work) are then assigned home or away accordingly.
Inputs
Table |
Content |
|---|---|
|
Household type definitions (which person types compose each household) |
|
Person type definitions (role, teleworking type) |
|
Markov transition probabilities from TUS |
|
Activity duration distributions from TUS |
|
Raw TUS activity sequences (144 slots/day) |
|
Day-start activity probabilities |
|
Activity → location mapping (home / away / variable) |
|
Activity → appliance mapping probabilities |
|
Appliance power ratings (Watt) |
|
Appliance usage duration (in 10-min slots) |
|
Work-from-home probability per teleworking type |
|
Lookup tables for activity, person type, location, technology IDs |
Outputs
Table |
Resolution |
Key columns |
|---|---|---|
|
10-minute (144/day × 365 = 52,560 rows) |
|
|
Hourly (8,760 rows) |
|
The household profiles table is the primary handoff to FLEX-Operation, linked via OperationScenario_BehaviorProfile.
Key Code Locations
File |
Role |
|---|---|
|
Entry point — |
|
Markov chain simulation at the individual level |
|
Member aggregation, lighting and base load addition |
|
Loads TUS parameters and person profiles into memory |
|
Named constants (activity IDs, person type IDs, mark functions) |
|
Offline preprocessing of raw TUS data into transition probability tables |
How to Run
python -m projects.test_behavior.main
Output is written to projects/test_behavior/output/.