Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Named State Variables (autosetvars) #78

Open
rburghol opened this issue Jul 25, 2023 · 0 comments
Open

Local Named State Variables (autosetvars) #78

rburghol opened this issue Jul 25, 2023 · 0 comments

Comments

@rburghol
Copy link

rburghol commented Jul 25, 2023

  • These are variables that are created on a component within it's simulation space.
  • They are stored at the end of each time step.
  • They can also be linked to the parent as an implicit derivate link. For example:
    • a channel object called 'local_channel' will create several properties on it's parent:
      • local_channel_Qin, local_channel_Qout, local_channel_demand, ...
  • Classes that use this:
    • SimpleChannel SimpleChannel #77
    • DataMatrix (when autosetvars = 1) dataMatrix #26
    • Impoundment (TBD)
    • Broadcast send -- check this out, should all others follow this convention or do we think it should be refined and renewed?
      • Basically, this creates a ModelRegister (which is a special type of ModelConstant that zeroes every time step)
      • Then it Creates a ink to that register to populate it every time step.
      • How is this different than a regular input? An input does NOT have it's value recorded as a new variable on the receiving object, rather, the receiving object uses that data that is housed remotely in another location
      • The more simplified method is to simply create a constant with state_path = /STATE/path_to_parent/new_local_variable_name
        • doesn't that become automatically discoverable if any input is looking for the variable, like if Qin = Qup + local_channel_Qout isn't that all we need?
  • To create:
    • call class function create_parent_var()
      • Make a constant: ModelConstant(keyname, self, float(keyval))
    • Does this need a variable register, and an input link to the parent, or is the variable implicit with path finding, so just a variable will suffice?
      • Or can this be handled more simply, with a single variable created on the parent,
      • and that is the repository for the data that the child stores in state
      • and automatically visible to the parent due to it's path being on the parent
      • and general object discovery techniques?
@rburghol rburghol changed the title Local Register Variables Local Named State Variables Jul 25, 2023
@rburghol rburghol changed the title Local Named State Variables Local Named State Variables (autosetvars) Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant