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

Vector inputs to Optimization Routines #2207

Open
10 tasks
cbroman-usnctech opened this issue Nov 1, 2023 · 2 comments
Open
10 tasks

Vector inputs to Optimization Routines #2207

cbroman-usnctech opened this issue Nov 1, 2023 · 2 comments
Labels
priority_minor task This tag should be used for any new capability, improvement or enanchment

Comments

@cbroman-usnctech
Copy link


Issue Description

I am looking to run an Optimization routine such as Gradient Descent or Genetic Algorithm on a vector of values.

For example: I have a building of 80 stories, I want to optimize the number of tenants on each floor to maximize profit. (More people means smaller rooms = less $ per room, Fewer people bigger rooms = more $ per room, higher up = $ more money). I would like to initialize a vector named tenantSize of length 80, with a range of 1-100.

To take this one step further could I run this Optimization concurrently on 20 buildings of differing height (different number of floors). Where the fitness is based on the collective fitness of the 20 buildings?

Is your feature request related to a problem? Please describe.
The issue is I have multiple, nearly identical variables, I would like to update in my model all at one time, but they do need to remain unique in that their placement within the model matters to the fitness.

Describe the solution you'd like
Optimization routines can handle vectors of inputs rather than scalers.

Describe alternatives you've considered
Writing a script that generates 20 X 80 unique scalers and plugs them into the input xml, then map them back to their respective places in our interface.


For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.

  • 1. Is it tagged with a type: defect or task?
  • 2. Is it tagged with a priority: critical, normal or minor?
  • 3. If it will impact requirements or requirements tests, is it tagged with requirements?
  • 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • 5. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

  • 1. If the issue is a defect, is the defect fixed?
  • 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • 4. If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • 5. If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
@cbroman-usnctech cbroman-usnctech added priority_minor task This tag should be used for any new capability, improvement or enanchment labels Nov 1, 2023
@alfoa
Copy link
Collaborator

alfoa commented Nov 24, 2023

@cbroman-usnctech hope everything is going great. can you attach an input (with "masked" variables) that show what/how you envision the modification to work? (I might have a need to something similar and I probably implement a common approach)

@cbroman-usnctech
Copy link
Author

Hi @alfoa! Swimmingly 🏊. Hoping the same to you!

For the above building analogy, my proposed input would look something like the following:

 <Optimizers>
    <GeneticAlgorithm name="GAoptimizer">
      <samplerInit>
        <limit>5</limit>
        <initialSeed>42</initialSeed>
        <writeSteps>final</writeSteps>
      </samplerInit>

      <GAparams>
        <populationSize>17</populationSize>
        <reproduction>
          <crossover type="onePointCrossover">
            <crossoverProb>0.9</crossoverProb>
          </crossover>
          <mutation type="swapMutator">
            <mutationProb>0.1</mutationProb>
          </mutation>
        </reproduction>
        <fitness type="logistic">
          <a>0.2</a>
          <b>13.0</b>
        </fitness>
        <parentSelection>rouletteWheel</parentSelection>
        <survivorSelection>fitnessBased</survivorSelection>
      </GAparams>

      <convergence>
        <objective>-1</objective>
      </convergence>

      <constant name="buildingNum">10.0</constant>      <!--  defines the number of buildings (assemblies) -->

      <variable type=vector name="FloorNums">                  <!-- initializes the number of floors (blocks) in a building -->
        <distribution>unif_dist</distribution>
        <initial>80,30,20,2,50,60,23,80, 45,67</initial>
      </variable>

      <variable type=vector name="tenantNum">            <!-- check what happens with vector of tenants (list of concentrations) -->
        <distribution>unif_dist</distribution>
      </variable>


    </UniformDiscrete>
        <UniformDiscrete name='uniform_dist'>
      <lowerBound>1</lowerBound>
      <upperBound>100</upperBound>
      <strategy>withOutReplacement</strategy>
    </UniformDiscrete>

The function will optimize on all buildings (assemblies), of various heights, and different tenant concentrations.

The final fitness ($) will be a function of its FloorNums (axial-Z-height), tenantNum (components), and building size. Let me know if this needs some clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority_minor task This tag should be used for any new capability, improvement or enanchment
Projects
None yet
Development

No branches or pull requests

2 participants