lly it should not make much of a difference - random number generation is not affected, mutation also is not. crossover is a bit more tricky, I use Simulated Binary Crossover (SBX-20) which was introduced already in 1194:
Deb K., Agrawal R. B.: Simulated Binary Crossover for Continuous Search Space, inIITK/ME/SMD-94027, Convenor, Technical Reports, Indian Institue of Technology, Kanpur, India,November 1994
Abst ract. The success of binary-coded gene t ic algorithms (GA s) inproblems having discrete sear ch sp ace largely depends on the codingused to represent the prob lem variables and on the crossover ope ratorthat propagates buildin g blocks from pare nt strings to childrenst rings . In solving optimization problems having continuous searchspace, binary-co ded GAs discr et ize the search space by using a codingof the problem var iables in binary st rings. However , t he coding of realvaluedvari ables in finit e-length st rings causes a number of difficulties:inability to achieve arbit rary pr ecision in the obtained solution , fixedmapping of problem var iab les, inh eren t Hamming cliff problem associatedwit h binary coding, and processing of Holland 's schemata incont inuous search space. Although a number of real-coded GAs aredevelop ed to solve optimization problems having a cont inuous searchspace, the search powers of these crossover operators are not adequate .In t his paper , t he search power of a crossover operator is defined int erms of the probability of creating an arbitrary child solut ion froma given pair of parent solutions . Motivated by t he success of binarycodedGAs in discret e search space problems , we develop a real-codedcrossover (which we call the simulated binar y crossover , or SBX) operatorwhose search power is similar to that of the single-point crossoverused in binary-coded GAs . Simulation results on a number of realvaluedt est problems of varying difficulty and dimensionality suggestt hat the real-cod ed GAs with t he SBX operator ar e ab le to perform asgood or bet t er than binary-cod ed GAs wit h t he single-po int crossover.SBX is found to be particularly useful in problems having mult ip le optimalsolutions with a narrow global basin an d in prob lems where thelower and upper bo unds of the global optimum are not known a priori.Further , a simulation on a two-var iable blocked function showsthat the real-coded GA with SBX work s as suggested by Goldberg
and in most cases t he performance of real-coded GA with SBX is similarto that of binary GAs with a single-point crossover. Based onth ese encouraging results, this paper suggests a number of extensionsto the present study.
7. ConclusionsIn this paper, a real-coded crossover operator has been develop ed bas ed ont he search characte rist ics of a single-point crossover used in binary -codedGAs. In ord er to define the search power of a crossover operator, a spreadfactor has been introduced as the ratio of the absolute differences of thechildren points to that of the parent points. Thereaft er , the probabilityof creat ing a child point for two given parent points has been derived forthe single-point crossover. Motivat ed by the success of binary-coded GAsin problems wit h discrete sear ch space, a simul ated bin ary crossover (SBX)operator has been develop ed to solve problems having cont inuous searchspace. The SBX operator has search power similar to that of the single-po intcrossover.On a number of t est fun ctions, including De Jong's five te st fun ct ions, ithas been found that real-coded GAs with the SBX operator can overcome anumb er of difficult ies inherent with binary-coded GAs in solving cont inuoussearch space problems-Hamming cliff problem, arbitrary pr ecision problem,and fixed mapped coding problem. In the comparison of real-coded GAs wit ha SBX operator and binary-coded GAs with a single-point crossover ope rat or ,it has been observed that the performance of the former is better than thelatt er on continuous functions and the performance of the former is similarto the lat ter in solving discret e and difficult functions. In comparison withanother real-coded crossover operator (i.e. , BLX-0 .5) suggested elsewhere ,SBX performs better in difficult test functions. It has also been observedthat SBX is particularly useful in problems where the bounds of the optimum
point is not known a priori and wher e there are multi ple optima, of whichone is global.Real-coded GAs wit h t he SBX op erator have also been tried in solvinga two-variab le blocked function (the concept of blocked fun ctions was introducedin [10]). Blocked fun ct ions are difficult for real-coded GAs , becauselocal optimal points block t he progress of search to continue towards t heglobal optimal point . The simulat ion results on t he two-var iable blockedfunction have shown that in most occasions , the sea rch proceeds the way aspr edicted in [10]. Most importantly, it has been observed that the real-codedGAs wit h SBX work similar to that of t he binary-coded GAs wit h single-pointcrossover in overcoming t he barrier of the local peaks and converging to t heglobal bas in. However , it is premature to conclude whether real-coded GAswit h SBX op erator can overcome t he local barriers in higher-dimensionalblocked fun ct ions.These results are encour aging and suggest avenues for further research.Because the SBX ope rat or uses a probability distribut ion for choosing a childpo int , the real-coded GAs wit h SBX are one st ep ahead of the binary-codedGAs in te rms of ach ieving a convergence proof for GAs. With a direct probabilist ic relationship between children and parent points used in t his paper,cues from t he clas sical stochast ic optimization methods can be borrowed toachieve a convergence proof of GAs , or a much closer tie between the classicaloptimization methods and GAs is on t he horizon.
In short, according to the authors my SBX operator using real gene values is as good as older ones specially designed for discrete searches, and better in continuous searches. SBX as far as i know meanwhile is a standard general crossover operator.
But:
- there might be better ones out there i just havent seen yet. please tell me.
- besides tournament selection and mutation, crossover is just one part of the breeding pipeline. also there is the elite management for MOEA which is AT LEAST as important as the breeding itself.
- depending on the problem, there are almost always better specific ways of how to code the mutation and the crossover operators. but octopus is meant to keep it general for the moment - maybe there's a way for an interface to code those things yourself..!?
2) elite size = SPEA-2 archive size, yes. the rate depends on your convergence behaviour i would say. i usually start off with at least half the size of the population, but mostly the same size (as it is hard-coded in the new version, i just realize) is big enough.
4) the non-dominated front is always put into the archive first. if the archive size is exceeded, the least important individual (the significant strategy in SPEA-2) are truncated one by one until the size is reached. if it is smaller, the fittest dominated individuals are put into the elite. the latter happens in the beginning of the run, when the front wasn't discovered well yet.
3) yes it is. this is a custom implementation i figured out myself. however i'm close to have the HypE algorithm working in the new version, which natively has got the possibility to articulate perference relations on sets of solutions.
…
I live on my computer and I even sleep with it, so learning all this is probably within my reach but I'm a complete beginner as of now.
I'm downloading the 32 bit version of rhino 5 since the 64 bit doesn't seem to work with your downloads Jon.
I haven't grasped everything you have made yet Jon I can't even begin to understand what your IFC stuff is actually capable of, but just to be clear I'm not interested in solely being able to tell that something is colliding as there are already software that can do that beautifully. What I want to do is bypass that step altogether by never having collision-checking back and forth go on, even collisions which aren't physical collisions, but rather just violations by code. The simplest way to do this would be to simply make the geometry of the beams 2 feet wider than they are in real life, so that way you could put a light right next to the 'over-sized' beam and it would still be within the rules. But that would be extremely primitive and I'm sure there's a way to do it mathematically.
Just to clarify, I'm the fire sprinkler designer in the architectural circus. The sprinkler designer (me) doesn't really get the luxury of telling the other trades that they're colliding with my stuff and they should move. Rather, I get their drawings, find out I'm colliding with them, and move around them. So it would be of great use to me to have this be automatic - that is, to automatically space my sprinklers the neccesary distance away from all obstructions. There are different spacing rules for different obstructions - walls, beams, open web steel, unit heaters, hvac ducts depending on how wide the ducts are, lights, fans, high rack storage, basically anything that would obstruct the water spray from a sprinkler needs to be taken into account and spaced away from.
It's therefore a very attractive idea to be able to just draw a rectangle (representing the walls of a simple room) for instance, have the sprinklers automatically spaced as far apart as possible within the rectangle according to the rulebooks (to minimize the amount of sprinklers needed which minimizes the material cost of the job).
Then add obstructions inside the rectangle, such as a beam, and have the sprinklers relocate themselves or add new sprinklers to accommodate for the new obstruction.. Keep adding obstructions until you have the realistic 3d model of the room, with the sprinklers spaced accordingly, and you have an up-to-code sprinkler system.
There is one example where sprinklers actually need to be spaced really close to, rather than away from, an object.. and that is the ceiling (sprinklers must be within 12 in of ceiling typically).
If the HVAC guy decides to reroute his ducts right through my sprinklers, then I could draw 3D HVAC ducts (I usually get 2D drawings coming in) going right through the room and the sprinklers would relocate and auto-space away from the ducts, without actually having to tell the HVAC guy he is colliding with me because all that will do is require me to do a redesign anyway.
And presto, the HVAC guy loves me because I didn't complain to him at all and seemingly did all this work by moving around him when all I really did was use the computer to do it, the job gets done much faster and I don't have to worry that I'm going to lose my job in court because I made a silly human error when I was patching my system manually because some HVAC guy made me redesign 12 times in different places.
From what I have been reading from you guys, doing this is possible although (I realize) ambitious. The end result would be vastly increased productivity, less error making, cheaper design cost, etc. Using programs like Rhino, architects are getting more and more funny-shaped buildings and making it difficult for guys like me to make sprinkler systems within the rules, and I see it as an inevitability that computers will be making almost all of the typical design decisions in the future when it comes to life safety systems, I'm just trying to see if it's possible to start implementing this extra aid today.
…
a type hierarchy with two interfaces and three classes:
IVehicle
IAutomobile
Bicycle
VolvoCar
AudiCar
IVehicle is an interface which lays down some ground-rules for all sort of vehicles. For example their maximum speed, maximum number of occupants and fuel type (diesel, horse, foot-power).
Bicycle is a class which implement IVehicle and nothing else.
IAutomobile is another interface, which derives from IVehicle but adds some more rules. For example it also demands that any class implementing IAutomobile has a property telling you whether the steering wheel is on the left or the right and how many kilometers per litre of fuel it manages.
VolvoCar and AudiCar are classes that both implement IAutomobile (they are, after all, both a type of automobile). Since IAutomobile inherits from IVehicle, they need to also implement that interface. VolvoCar might look like this:
class VolvoCar : IAutomobile
{
public int MaxSpeed { get { return 160; } } //IVehicle implementation
public int MaxPeople { get { return 5; } } //IVehicle implementation
public string Fuel { get { return "diesel"; } } //IVehicle implementation
public double Consumption { get return "18.4"; } } //IAutomobile implementation
public bool WheelOnLeft { get { return true; } } //IAutomobile implementation
public string TypeCode { get { return "V70"; } } //A property only volvos have.
}
Now let's imagine that you are given an instance of VolvoCar. This can happen as one of four types:
System.Object (everything derives from System.Object, so this is always possible)
IVehicle (VolvoCar implements this interface because IAutomobile derives from it)
IAutomobile (VolvoCar specifically implements this interface)
VolvoCar (the type itself)
These are just four different ways of looking at VolvoCar, and each way allows you to see less or more detail. If you have a VolvoCar instance stored inside a variable of type IVehicle, then you do not have access to the steering wheel property, because that is not part of IVehicle. If you want to access WheelOnLeft or Consumption you can cast your instance to type IAutomobile:
Dim vehicle As IVehicle = GetVehicleFromSomewhere()
Dim car As IAutomobile = DirectCast(vehicle, IAutomobile)
The car and vehicle variables now both point to the same volvo in memory, but car allows you to access more information. You could even cast it to a VolvoCar, in order to get access not just to WheelOnLeft and Consumption, but also to TypeCode:
Dim vehicle As IVehicle = GetVehicleFromSomewhere()
Dim volvo As VolvoCar = DirectCast(vehicle, VolvoCar)
Note though that casting sort of violates the type-safetyness of a program. The GetVehicleFromSomewhere() function returns a variable of type IVehicle. So it is allowed to return VolvoCar, AudiCar or Bicycle without breaking that promise. But if it returns Bicycle then our attempt to cast it to an IAutomobile or VolvoCar will fail.
So, conclusion:
Casting allows you to look at an instance using a more detailed (or less detailed if you want) type. Pre-requisite is that the instance actually is of that type.
In VB.NET, you can use the DirectCast and TryCast methods for this. TryCast is to be preferred, but it only works on classes, not structs.
In C# you can use the (type)variable notation or the as keyword.
You can use the TypeOf (VB.NET) and is (C#) keywords to first see whether a cast will work or not.
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 2:58am on October 9, 2013
h, and using the BScale and BDistance are creating havoc somehow too. I've simplified first, and used the Kangaroo Frames component along with setting internal iterations, to make MeshMachine act like a normal component, along with releasing the FixC and FixV. The FixV didn't make any sense anyway. I've also set Pull to 0 to speed it up during testing, since much less calculation is involved to just let the meshes collapse, prevented from disappearing altogether by using a mere 15 iterations.
Also, your breps are open so that allows much more chaos and then collapse, though they did manage to close themselves too at times. Here is closed breps with a full 45 iterations:
So now that it's working, lets re-Fix the curves, and the problem arises that there is an extra seam line that is getting fixed too, running along the cylinder, stopping the mesh from pulling tight under tension wherever a vertex happens to be near that line:
So lets grab only the naked edge curves instead:
And what happens if we lose the end caps, now that we don't have an extra line skewing the result?:
There is no real curvature differences since it's not a curvy brep so the Adapt at full 1 setting has little to do. Now what does the BScale and BDist do? Nothing! Why? Your scale is out of whack, 99 mm high cylinders but only a falloff maximum of about 5, so let's make the falloff be 25 instead, but I must restore the end caps or the meshes collapse away for some reason and freezes Rhino for a minute or so the first time I try it:
It's a start.
If I intersect the cylinders, nothing changes, since they are being treated as separate runs. MeshMachine outputs a sequence of two outputs though, due to Frames being set to a bare minimum of 2 needed to get it to work, so I filter out the original run, which is just the unmodified initial mesh it creates.
The lesson so far is that closed meshes are much less prone to collapse and glitches leading to screw ups.
A Boolean union of the cylinders is when it gets funner, here show with and without the fixed curves that seem to define boundaries too where really there are just polysurface edges:
…
owing a tutorial is easy and adapting the idea of it again - it's not a fuss - i guess my skills are at 1 - since I can not yet stand alone! However I am very determined to nail this program to the ground and be at a 9 by Easter - of course that means a lot of work and hours testing - but I am young and ambitions!
I am a revit user and I just switched over (from the dark rigid side) to rhino because of a simple math problem which has to do with variations and combinations.
I am investigating the form factor for my thesis.
Form factor= building envelope (the area of the facade+the area of the roof+the area of the footprint)/the total area of the floors.
I have started by defining a specific set of parameters such as height, number of floors, maximum total floor area so I can compare the results.
Therefore the floating number will be the facade area - which in the end, considering the height is a constant - ends up being just the length of a certain shape - circle, square, triangle ...
I have done the calculation through excel after extracting from revit but only on simple shapes as follow(the following examples are my own analyzing work):
My problem is: I need a way to get all possible shapes that meet the criteria i put in - which at the moment will be defined by square meters of a floor- that is why galapagos comes in - I need it to make all possible combinations that can be computed that meet the criteria - so then the user(myself or who ever else want to use it) can make an informed choice. I am not looking for a square - circle, sphere or anything I can manually create by just using basic geometry, I am looking for all the possible combination that equal the same area.
(plan view)
After i can solve it for one level - i will constrain that all the levels add up have specific total area - so if a level get's bigger in size another one gets smaller. Again run it through Galapagos and get all possible outcomes (like the sections below)
I am aiming to get an outcome from which you have options to pick out of -> a design process not a specific shape.
You are thinking too complex - not that it's a bad thing - but I am looking for something more simplistic than that. I need a shape - windows and panels are for later use in my process and at this early stage completely irrelevant - and that will be another percentage math problem rather than aesthetics. I just need shapes to morph based on input parameters.
I hope this was an interesting read for you and I really appreciate your patience with me.…
I wanted to use it for a client, really I can't since they will freak out about a weird version of Rhino being needed.
http://discourse.mcneel.com/t/scripting-blendsrf/24635
http://mcneel.myjetbrains.com/youtrack/issue/RH-29978
What you call trivial is the core of your business, the core of your product, meaning Grasshopper user ability to access serious commands or not. This is, after all, one of the most important commands in the entire Rhino universe. Without it, I have to just completely abandon NURBS and edit meshes since I can't join surfaces smoothly so I have to stop using fragments at all and only meshes afford local detail well compared to single NURBS surfaces. Only polysurfaces can mix in little high UV count blends to deal with tight local detail.
I guess I'll switch to the WIP now. Test that, and just tell clients, hey, that's life. It's not exactly easy to find the WIP download, being a hidden "Serengeti" topic on the main Rhino forum, but I can offer the membership link.
http://discourse.mcneel.com/t/how-do-i-actually-download-serengeti/23846
http://www.rhino3d.com/download/rhino/wip
I had to manually install IronPython 2.7.5 too, to fix a broken Python system:
http://ironpython.codeplex.com/releases/view/169382
Now, where on Earth do I find the Rhinocommon manual for Rhino 6 WIP?
I guess it's within the main Rhino EditPythonScript editor, though that can't be searched like a normal manual:
CreateBlendSurface(face0: BrepFace, edge0: BrepEdge, domain0: Interval, rev0: bool, continuity0: BlendContinuity, face1: BrepFace, edge1: BrepEdge, domain1: Interval, rev1: bool, continuity1: BlendContinuity) -> Array[Brep]
Makes a surface blend between two surface edges.
face0: First face to blend from. edge0: First edge to blend from. domain0: The domain of edge0 to use. rev0: If false, edge0 will be used in its natural direction. If true, edge0 will be used in the reversed direction.
continuity0: Continuity for the blend at the start. face1: Second face to blend from. edge1: Second edge to blend from. domain1: The domain of edge1 to use. rev1: If false, edge1 will be used in its natural direction. If true, edge1 will be used in the reversed direction.
continuity1: Continuity for the blend at the start. Returns: Array of Breps if successful.
Now I have normal, productive homework, of figuring out how to specify edges from a Python script.
I'll just sell this extra special capability of Rhino 5 WIP from Grasshopper as a cutting edge advanced new feature other lowly consultants can't match, assuming I can get it to work first.
The initial strategy is to Grasshopper create discrete surfaces, blow holes in a parent surface, scale down and move the little surfaces away, and just blend everything together into a polysurface. Then a client won't freak out so badly when I show them how to use meshes instead, since at least there's an alternative straight from NURBS, that maybe isn't as creatively open ended, but will get them out of a bind if their own client freaks out about meshes converted to NURBS via ZBrush ZRemesher run through T-Splines to get a smooth NURBS polysurface surface that looks like odd patchwork.
Alas, the above Rhinocommon blurb is incomplete, lacking info about what values for continuity are defined as, such as position, tangency, or curvature. I guess I'll just use try numbers.
…
e following tutorial: http://digitaltoolbox.info/grasshopper-intermediate/offset-scale/
I think the beginning is correct because I have the same things. However, at the last step I can't correctly generate the tabs for assemble this shape. I try to put "flatten" everywhere but it doesn't work ... If someone just give me a little help please ? Or check if everything is okay? Or if there is an another tutorial ? Or if the question has already been asked in this forum ? I take! I'm really sorry if my problem is not very interesting but I'm new ... Yours, Anna, windows 7 on bootcamp Rhino 5 Grasshopper O.8.0063
Files :
Shape.3dm
Shape.gh
…
and where the decimal place should be.
The reason it only shows the first 5 numbers that make up 1,000,000 is because anything smaller than 100 is considered insignificant when talking about 1 million. Think of it like this if 1 million represents an Olympic size swimming pool then 10 would represent the volume of a full tank of petrol for an average family car. You would have to stand there for an extremely long time to fill up the pool from a petrol pump.
It's important to know that these insignificant digits are still there for the purpose of calculations but are just not being displayed.
There are times when you may want to display these numbers in a format that makes more sense, for these occasions we can use the Format() function.
Format() Function
For versions BEFORE 0.9.0001 the VB Format Function is available through the Expression Components found on the Math Tab > Script Panel
Either by using the F input* or the Expressions Editor found on the Context Menu you can apply a format mask to the x input.
* except FxN
Anatomy of the formatting function above:
Format(..............................) <-- VB function
Format("........................."....) <-- Display String
Format("{0....................}"....) <-- Place Holder for first variable
Format("{0:0.000000000}"...) <-- Format Mask for 9 decimal places
Format("{0:0.000000000}", x) <-- Variable
This can be applied to points and their components:
For versions AFTER 0.9.0001 there is a dedicated Format Component or you can use the Expressions Components successor Evaluate.
For more information on the tags used in the Format Function see these links.
Standard formatting tags Custom formatting tags
WARNING:
If you format a number to be displayed in this way it becomes a string and will no longer have the complete Real number available for calculations. Always use the input to the format function for further requirements in calculations.…