Agent modeling of a pervasive application to enable deregulated energy markets