Skip to content

Commit

Permalink
Merge pull request #91 from bartvm/synthesis
Browse files Browse the repository at this point in the history
WIP: Datasets and monitoring
  • Loading branch information
bartvm committed Jan 14, 2015
2 parents eafc88a + 7ce8562 commit 9d75f0f
Show file tree
Hide file tree
Showing 14 changed files with 1,188 additions and 22 deletions.
14 changes: 9 additions & 5 deletions blocks/bricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,21 @@ def __init__(self, brick, application):
self.auxiliary_variables = []
self.updates = []

def add_auxiliary_variable(self, expression, role):
def add_auxiliary_variable(self, expression, role, name=None):
if name is not None:
expression.name = name
expression.tag.role = role
self.auxiliary_variables.append(expression)

def add_monitor(self, expression):
def add_monitor(self, expression, name=None):
return self.add_auxiliary_variable(expression,
role=VariableRole.MONITOR)
role=VariableRole.MONITOR,
name=name)

def add_additional_cost(self, expression):
def add_additional_cost(self, expression, name=None):
return self.add_auxiliary_variable(expression,
role=VariableRole.ADDITIONAL_COST)
role=VariableRole.ADDITIONAL_COST,
name=name)


class Application(object):
Expand Down

0 comments on commit 9d75f0f

Please sign in to comment.