Exemplo n.º 1
0
 def create_task_yaml(self):
     self.logger.info("Creating task file for Node {}".format(
         self.node_tag))
     file_ = join(Config.config_folder, self.config["template_file"])
     kwargs = {'node_tag': self.node_tag}
     data = template_task(file_, kwargs)
     dump_file(data, self.task_file)
     with open(self.task_file) as f:
         self.task_ = yaml.safe_load(f)
Exemplo n.º 2
0
    def create_bid_yaml(self):
        self.logger.info("Creating order file for Node {}".format(
            self.node_tag))
        self.bid_ = template_bid(self.config, self.node_tag,
                                 self.config["counterparty"])

        price_, predicted_, predicted_w_coeff_ = self.get_price()
        self.price = self.format_price(price_, readable=True)
        self.bid_["price"] = self.format_price(price_)

        self.logger.info(
            "Predicted price for Node {} is {:.4f} USD/h, with coefficient {:.4f} USD/h, order price is {}"
            .format(self.node_tag, predicted_, predicted_w_coeff_, self.price))
        dump_file(self.bid_, self.bid_file)