# Presentation: 370595

## Intelligent Agents for HVAC System Monitoring and Control

- “Given enough ants you can move a mountain.”
- ASHRAE Summer 2002
- Honolulu, Hawaii
- David Chassin
- Pacific Northwest National Laboratory

**U.S. Department of Energy**
**Pacific Northwest National Laboratory**

## Audience Participation Exercise

*We need 10 volunteers on stage*
- Line up in front, facing the screen.
- Follow the instructions on the next slide.
- Do not speak.

## Raise your hand when you understand these

- If the person in front of you is taller than you,
- then tap his shoulder and prepare to switch places with him
- If the person in back you taps your shoulder
- then switch places with him

## Consider these questions

- What was the function performed?
- Observers: consider these questions
- How well did they perform?
- How resistant was the system to individual errors?
- What will happen if you multiply the input size by 1000?
- Participants: raise your hand if...
- ...you found your task difficult to perform?
- ...you had troubles communicating?
- ...you were ever confused or made a mistake?

## Sorting with intelligent agents

- Each value has an semi-smart agent to contain it
- Agents run either sync/alt or async
- Time = N
- Space = N

- class Cell : public Agent
- {
- 	bool done;
- 	int value;
- 	Cell *next;
- }
- Cell::Update()
- {
- 	if (next->value > value) {
- 		SwapValue(next,this);
- 		done = false;
- 	} else
- 		done = true;
- }

## Watching the agents work

- Time to solve < N
- Space required ~ N
- Number of ops < N2/2
- Parallelization ~ N/2

*Now consider this:*
*Q: If it takes 100 soldiers 10 minutes to line up by height, how long will it take 1000 to do so?*
*A: It depends on what you tell them*

## Perspective: So what is an agent anyway?

- A FSM that
- by itself cannot do much of anything useful
- but when interacting with other ‘like-minded’ machine contributes to an emergent behavior that is the desired solution to a problem
- It’s about the system not the programs
- agents are networked into a system that solves the problem (control, calcs, algor.)
- the properties of the network are equally (if not more) important
- Key agent concepts
- locality principle (# links/agent not a function of # agents)
- emergent behavior (rough analog: photograph vs. hologram)
- In these systems you consider more
- behavioral (conservation, setpoints, halt) laws are locally enforced, not globally
- convergence is achieved by error diffusion and local correction

## Control with Agents: The Hypothesis

- Global optimization is emergent
- Local setpoints are maintained but negotiable
- Agents trade setpoints flexibility for resource access
- Price can be a signal mediator: contract net
- Transaction-based control
- Price is the only mediator
- All resources and services are commodities
- Basis for much simpler Plug and Play control paradigm
- Verifiable today by simulation only

## Centralized: Demand-based Control

## Distributed: Market-based Control

## Simulating with agents: Observations

- The emergent behavior is a time-series of sensor-like data
- ABS are a superset of Cellular Automata Machines
- similarities: individuals, sparse incidence, sync/async
- differences: multiple types of agents, not just NEWS/Moore
- in essence: an approach to easy massive parallelization
- ABS simulation approach works only when
- each agent enforces *all* the laws of physics internally
- convergence is based on local conservation laws
- emergent global behavior is not stated *a-priori*
- Behavior analysis does not require exhaustive runs
- very similar to analyzing real-life systems

## What I try to never forget

- The hypothesis verification is reversed
- ODE models pose global behavior and use topology to test whether data fits locally
- ABS models pose local laws and topology to test if data fits desired global behavior
- Agents should share as little information as possible
- It’s about the system, not the infrastructure
- Keep the communication simple
- Blackboards, Queries, or Messages
- Make sure I know _***all ***_the conservation laws
- ...and that I know how to enforce them locally
- If I need a special case or global data I probably did something wrong
- Control, data collection and debugging are hard
- ...but I’ve go to do them to see what’s going on so I do them early
- Foreign interfaces (aka boundary conditions) and hybrids
- Use agents to handle these situations too

## How to simulate a system with agents

- Some ground rules
- uniform concept for what information must be shared (i.e., clearly define the dimensions of your solution space)
- each agent must enforce all local conservation laws
- global conservation laws must be enforced by boundary agent(s)
- conservation law violations can be distributed to neighbor using any number of strategies:
- uniform, flow weighted, rate of change weighted, etc...
- time is not advanced uniformly at each iteration (that *is *a real global)
- 6 basic steps...

## 6 Steps to Successful Agent-Based Simulation

- Define the connectivity paradigm
- Define what is shared by agents.  This is usually the solution vector you seek.
- Define the behaviors of each agent class
- Conservation laws
- Local incidence rules (can be anything) and port limits
- Parametric behaviors
- Instantiate the agents of each class
- Set parameters
- Connect the agents in the realized topology
- Link agents together
- Start the agents
- Run their update loops until nothing changes
- Collect data
- Gather shared data.  For debugging gather internal data too.

## Using FPGAs to implement agent systems

- Programmable gate array is a cell-based logic device
- Input VHDL models can define diagrams, procedures and/or schematics
- Using VHDL we designed a simple power system with 1 generator, 2 buses, 1 line and 1 load using ABS query model.
- The system converges to solutions in an average time of...
*	**	**	**	**Care you venture a guess?*

## 30 nanoseconds!

## The implications of this result are interesting

- Speed isn’t everything... it’s the only thing.
- Precision without accuracy is useless.  FPGAs are accurate without being unnecessarily precise.
- Being integer based, they can be analyzed using advanced combinatorial mathematics.  This means we can explore the emergent behavior of the system using discrete decision network models without experiencing exponential time growth.
- If the FPGA platforms work in general they may be effective substitutes for many slower, more cumbersome computational platforms.

## Conclusion: Is this a new science?

- Not yet: I believe it’s still art
- I can’t tell which rule produces which behaviors
- Nor can I tell what behavior will occur given a rule
- BTW: This is where GAs/EAs come into the picture
- It will become a science eventually
- Only after syntax and semantics are joined
- The _T_heory does not yet exist (despite Wolfram’s claim)
- We’re getting close though

## Questions and Comments

*Contact information*
- David Chassin, Staff ScientistEnergy Science & Technology DivisionPacific Northwest National Laboratory
- david.chassin@pnl.gov