Implement DirectAlgorithm and add energy consume model