this case "13."
I am trying to find the logical way to output that item value as a percentage of the overall list's domain. For example, I need to convert 13 to a value of .5 representing it being the median value of the list. 11 would be 0.0, 12 would be .25, etc...
Any help would be greatly appreciated…
example 10.5 is exactly halfway or at 50%, 12 is at 200%, 5 is at -500%. If you were to remap these values into the other domain, their percentages ought to remain the same, ie.:
10.5 = 50% becomes 0 (because 0 halfway -100 to 100)
12 = 200% becomes 300
5 = -500% becomes -1100
The most common use of Remap Numbers is to change a set of measurements to be within a given goal domain. For example if you measure brightnesses using the Image Sampler, you get values between 0.0 (black) and 1.0 (white). However these brightnesses are supposed to control rotational angles between 10 and 45 degrees. Thus, you use a Remap component with the source domain (0.0 to 1.0) and the target domain (10 to 45).…
Loop'. The fun part of the slower version is that you can see what it's doing while it's running. 'Fast Loop' gives no indication that it's working, so you want to test it with small numbers and be sure it's coded properly before bumping the iteration count up.
The GH profiler running the slow version showed between 1 and 1.5 seconds per loop, but the reality was more like ~10 seconds per loop toward the end of an 11 X 11 grid, or ~20 minutes total. It's easier to be patient because you know it's working.
The 'Fast Loop' finished the same grid in 1.6 minutes! An impressive improvement. I've been running it on a 30 X 30 grid (900 points) for ~23 minutes so far and see nothing yet. Not the ~12 minutes I had hoped for... Now 36 minutes on this loop for 900 points... hope it's not stuck. Not fast! Later - DONE!! Profiler says 59 minutes for 900 points but it was more like an hour and twenty minutes total. It succeeded, I have a single 'Closed Brep' from 900 extruded rings, baked to Rhino.
Another strategy to explore would be doing 'SUnion' on a smaller grid using the Anemone loop, then replicate it by moving it as needed to form a larger grid; then run the copies through another 'SUnion' loop. I went ahead and implemented that while waiting. It works and is fast! Started with 3 X 3 and ran the result again as 5 X 5 (9 X 25 = 225 total) in barely ~70 seconds!? Trying 36 X 36 now... 1,296 points appears to have succeeded in less than ten minutes! Though it seems to take quite awhile after the loop ends before control is restored to GH/Rhino. I'll let you do your own experiments and benchmarks.
I encapsulated the loop in a cluster called 'suLoop' (blue groups).
Internal of 'suLoop' cluster:
…
Added by Joseph Oster at 11:14pm on March 22, 2017
nput parameter and then set the named values on the second?
protected override void BeforeSolveInstance() { Param_Integer param0 = Params.Input[0] as Param_Integer; Param_Integer param1 = Params.Input[1] as Param_Integer; param1.ClearNamedValues();
GH_Structure<GH_Integer> data = param0.VolatileData as GH_Structure<GH_Integer>; if (data.IsEmpty) return; foreach (GH_Integer value in data.AllData(true)) { switch (value.Value) { case 1: param1.AddNamedValue("First option for 1", 11); param1.AddNamedValue("Second option for 1", 12); param1.AddNamedValue("Third option for 1", 13); break;
case 2: param1.AddNamedValue("First option for 2", 21); param1.AddNamedValue("Second option for 2", 22); param1.AddNamedValue("Third option for 2", 23); break;
case 3: param1.AddNamedValue("First option for 3", 31); param1.AddNamedValue("Second option for 3", 32); param1.AddNamedValue("Third option for 3", 33); break; } return; } }
--
David Rutten
david@mcneel.com…
Added by David Rutten at 1:56am on December 18, 2013
means Galapagos has got nothing to go on.
Your fitness value needs to reflect the fitness of the slider position. Then, Galapagos needs to be told what it is supposed to be looking for. I.e. it should try and minimize the fitness value (lower = better), maximize the fitness value (higher equals better) or optimize the fitness value (closer to X = better).
I attached two files, one extremely simple, one a bit more involved. They both solve the same problem. Be sure to have a good look at the Galapagos settings, as they differ in both files.
There's one more thing I should say. Galapagos has algorithms build in that prevent the same genome from occurring more than once in any given species. If you have an Integer slider with 11 possible settings, that means you can only have 11 unique genomes. Galapagos will exhaust this pool in half no time, after which it will seem to jump randomly back and forth, desperately trying to find another unique genome (and always failing). This is why I used floating point sliders, to increase the number of possible unique genomes.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 3:52am on October 18, 2010
very surface i.e. 33, which you are trying to match up with 3 surfaces in a single list. Which is the second issue you would need to graft the single list of surfaces before inputing them to both the P and C inputs. That way you are making GH Match the first surface with the first set of points and so on. and not every surface with each set of points.
To sort out the Data structure coming from the grid use a pathmapper with {A;B;C;D}(i) --> {A;B}…
Added by Danny Boyes at 4:11am on February 7, 2011
as follows.
We have a grid which consists of a collection of columns, where each column consists of a list of points. You said flattening is out of the question, so we need to cull items from each list individually.
Let's say our culling pattern is KDDDKDD (repeat as needed). K = Keep, D = Ditch. If a column contains 18 points, the pattern needs to be repeated until it is 18 items long. In this case:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
K D D D K D D K D D D K D D K D D D
We can now cull each column, but they will all be culled in the same way. By shifting the pattern one more index for each column, we can cycle the culling.
The fix incidentally is to Shift the pattern PRIOR to repeating it. Then it works as expected:
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 2:49pm on October 2, 2013
gh, when I bake, the geometry suddenly exists in rhino.
Second, I can seem to figure out how to set default numeric values in the component.
Protected Overrides Sub RegisterInputParams(pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager)
pManager.AddPointParameter("Focal Point", "FP", "The focal point", GH_ParamAccess.item)
pManager.AddNumberParameter("Focal Point Horiz Dist", "D", "Focal point distance from performance boundary", GH_ParamAccess.item)
pManager.AddNumberParameter("Focal Point Height", "H", "Focal point height above performance boundary", GH_ParamAccess.item)
pManager.AddPointParameter("First Row Start Point", "FR", "Location of first row in tiered seating", GH_ParamAccess.item)
pManager.AddNumberParameter("First Row Horiz Dist", "FRD", "First row distance from performance boundary", GH_ParamAccess.item)
pManager.AddNumberParameter("First Row Height", "FRH", "First row height above performance boundary", GH_ParamAccess.item)
pManager.AddNumberParameter("C Value", "C", "C value", GH_ParamAccess.item)
pManager.AddNumberParameter("Row Width", "RW", "Row width", GH_ParamAccess.item)
pManager.AddIntegerParameter("Number of Rows", "RN", "Number of Rows", GH_ParamAccess.item)
pManager.AddIntegerParameter("Construction Tolerance", "CT", "Construction Tolerance: 1=1in, 2=1/2in, 4=1/4in, 8=1/8in", GH_ParamAccess.item)
pManager.AddNumberParameter("Max Riser Height", "MR", "Maximum riser height allowed", GH_ParamAccess.item)
pManager.AddGeometryParameter("Spectator", "S", "Seated/Standing spectator", GH_ParamAccess.item)
End Sub
Protected Overrides Sub RegisterOutputParams(pManager As Grasshopper.Kernel.GH_Component.GH_OutputParamManager)
pManager.AddLineParameter("Sightlines", "SL", "Sightlines", GH_ParamAccess.list)
pManager.AddLineParameter("C Value", "CL", "Line represents C value height", GH_ParamAccess.list)
pManager.AddLineParameter("Ground Line", "GL", "Ground Line", GH_ParamAccess.list)
pManager.AddLineParameter("Tier tread", "TR", "Line represents tier treads", GH_ParamAccess.list)
pManager.AddLineParameter("Risers", "RI", "Line represents risers", GH_ParamAccess.list)
pManager.AddGeometryParameter("Spectators", "SP", "Seated Standing Spectators", GH_ParamAccess.list)
End Sub
Protected Overrides Sub SolveInstance(DA As IGH_DataAccess)
Dim newLine As New List(Of Line)
Dim newCValue As New List(Of Line)
Dim rowWidthLineList As New List(Of Line)
Dim floorLineList As New List(Of Line)
Dim riserLineList As New List(Of Line)
Dim leghtList As New List(Of String)
Dim newSeated As New List(Of GeometryBase)
Dim inputPoint As Point3d
If (Not DA.GetData(0, inputPoint)) Then Return
Dim viewPointY As Double
If (Not DA.GetData(1, viewPointY)) Then Return
Dim viewPointZ As Double
If (Not DA.GetData(2, viewPointZ)) Then Return
Dim firstRowPoint As Point3d
If (Not DA.GetData(3, firstRowPoint)) Then Return
Dim firstRowY As Double
If (Not DA.GetData(4, firstRowY)) Then Return
Dim firstRowZ As Double
If (Not DA.GetData(5, firstRowZ)) Then Return
Dim cValue As Double
If (Not DA.GetData(6, cValue)) Then Return
Dim rowWidth As Double
If (Not DA.GetData(7, rowWidth)) Then Return
Dim numberOfRows As Integer
If (Not DA.GetData(8, numberOfRows)) Then Return
Dim M As Integer
If (Not DA.GetData(9, M)) Then Return
Dim maxHeight As Double
If (Not DA.GetData(10, maxHeight)) Then Return
Dim seated As GeometryBase
If (Not DA.GetData(11, seated)) Then Return
Call addNewRow(newLine, newCValue, inputPoint, viewPointY, viewPointZ, firstRowPoint, firstRowY, firstRowZ, cValue, numberOfRows, rowWidth, rowWidthLineList, floorLineList, riserLineList, M, maxHeight, seated, newSeated)
DA.SetDataList(0, newLine)
DA.SetDataList(1, newCValue)
DA.SetDataList(2, rowWidthLineList)
DA.SetDataList(3, floorLineList)
DA.SetDataList(4, riserLineList)
DA.SetDataList(5, newSeated)
End Sub
Public Sub addNewRow(---constructor----)
---additional code----
end Sub…
the Options. For example, if we look at the default settings in this order:
Population: Number of iterations / generation 50 - Galapagos tries 50 slider positions each generation. When it finishes 50, it looks at the results and takes from the best results based on your fitness.
Initial Boost: Factor for the first generation 2. You want to ensure Galapagos sees as much of the solution space as possible in order to not miss any potential solutions. The first generation is multiplied by this factor. If Population is 50, the first generation will be 50x2 = 100 slider positions.
Maintain and Inbreeding deal with what you keep between Generations.
Max Stagnant: Number of generations to try AFTER finding a better solution 50. If Galapagos finds a great solution in Generation 2 (Gen 0 = 100 tries, Gen 1 = 50 tries, Gen 2 = 50 tries) it will go another 50 Generations (50x50 tries) before it stops to ensure it did not miss anything.
Your solution space consists of 11 options, which is much less than any of the other parameters are suggesting. Galapagos flails wildly in your case because you told it to. You told it to try 50x50(+50 for initial boost) number of times to find the best value.
Hence why I do not think this is the best option. You said it, this is not an optimization problem. If it is not an optimization problem, why use a genetic algorithm solver which is predominantly used for optimizing parameters?
I wouldn't necessarily want to see the definition, I'm more curious about the data. For example, can you send the data for 10 structural members and some load cases? (again, I could be entirely oversimplifying it).
In any case, I changed Max. Stagnant to 5, Population to 11. So Galapagos will stop (5x11)+11 tries AFTER the best solution is found. It found the solution pretty quickly.…
Added by Luis Fraguada at 6:07am on September 7, 2016
hange to a rectangle or a sequence of lines to get the tube geometry. Author of the video explained how to do this in the comments, but that didn't help. :(
"Alan Rodriguez Carrillo 1 year ago + Aldo Villanueva Hi, what you can do is try to handle points (4) with the ListITEM component and change the order of relation, for example (0,1) (1,2) (2,3) (3, 4) (4.0) in a panel. Subsequently do the relation of points through a line from points or LineSDL and elaborate the same steps that are explained in this video. Thanks.
Carlos González Puchol 11 months ago + Aldo Villanueva + Alan Rodríguez Carrillo Buenas, Alan and Aldo. I made a closed, tube design. First I listed the 4 points and put them in order with the polyline the polyline, making it closed. Then I had to close them also in the last steps before doing the triangulation."
Can anyone explain how to make this work ? It seems easy. For a person that knows the trick :))
https://www.dropbox.com/s/9dnyfoielum6m1r/PABELLON_last.3dm?dl=0 https://www.dropbox.com/s/y8xdiaf66xbyn9l/PAVILION.gh?dl=0…