Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
renamed optcontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishit Gajjar authored and Nishit Gajjar committed Apr 23, 2019
1 parent 099af4d commit 5c334fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions optimization/controllerDiscrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
import pyutilib.subprocess.GlobalData
pyutilib.subprocess.GlobalData.DEFINE_SIGNAL_HANDLERS_DEFAULT = False

class OptController(threading.Thread):
class OptControllerDiscrete(threading.Thread):

def __init__(self, id, solver_name, model_path, control_frequency, repetition, output_config, input_config_parser,
config, horizon_in_steps, dT_in_seconds, optimization_type):
# threading.Thread.__init__(self)
super(OptController, self).__init__()
super(OptControllerDiscrete, self).__init__()
self.logger = MessageLogger.get_logger(__file__, id)
self.logger.info("Initializing optimization controller " + id)
# Loading variables
Expand Down Expand Up @@ -81,7 +81,7 @@ def path_import2(self, absolute_path):

def join(self, timeout=None):
self.stopRequest.set()
super(OptController, self).join(timeout)
super(OptControllerDiscrete, self).join(timeout)

def Stop(self):
try:
Expand Down
14 changes: 7 additions & 7 deletions swagger_server/controllers/threadFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from IO.inputConfigParser import InputConfigParser
from IO.redisDB import RedisDB
from optimization.ModelException import MissingKeysException
from optimization.controllerDiscrete import OptController
from optimization.controllerDiscrete import OptControllerDiscrete
from optimization.controllerMpc import OptControllerMPC
from prediction.loadPrediction import LoadPrediction
from prediction.pvPrediction import PVPrediction
Expand Down Expand Up @@ -160,14 +160,14 @@ def startOptControllerThread(self):
self.repetition, output_config, input_config_parser, config, self.horizon_in_steps,
self.dT_in_seconds, self.optimization_type)
elif self.optimization_type == "discrete":
self.opt = OptController(self.id, self.solver_name, self.model_path, self.control_frequency,
self.repetition, output_config, input_config_parser, config, self.horizon_in_steps,
self.dT_in_seconds, self.optimization_type)
self.opt = OptControllerDiscrete(self.id, self.solver_name, self.model_path, self.control_frequency,
self.repetition, output_config, input_config_parser, config, self.horizon_in_steps,
self.dT_in_seconds, self.optimization_type)
elif self.optimization_type == "stochastic":
# need to put correct controller
self.opt = OptController(self.id, self.solver_name, self.model_path, self.control_frequency,
self.repetition, output_config, input_config_parser, config, self.horizon_in_steps,
self.dT_in_seconds, self.optimization_type)
self.opt = OptControllerDiscrete(self.id, self.solver_name, self.model_path, self.control_frequency,
self.repetition, output_config, input_config_parser, config, self.horizon_in_steps,
self.dT_in_seconds, self.optimization_type)

try:
####starts the optimization controller thread
Expand Down

0 comments on commit 5c334fc

Please sign in to comment.