House Designer
Transcription
House Designer
House Designer Using Knowledge Based Engineering and Lisp to automatically design buildings Kristoffer Kvello SELVAAG © Selvaag 2008 1 Sunday, August 13, 2017 Table of contents • • • • • • • House Designer (what is it?) Why Lisp? Knowledge Based Engineering Libraries we use Use of Screamer by House Designer Some thoughts about using Lisp for this Users The company • Selvaag • One of Norway’s ten largest construction companies • Around 700 employees • Selvaag Bluethink • Daughter company writing software • 24 employees The company • The Lisp-team – 6 developers • one of which is the primary author of Movitz and Binary-Types – http://common-lisp.net/project/movitz/ – http://www.cs.uit.no/~frodef/sw/binary-types/ House Designer • System for automatic design of apartments and buildings • Based on sketches from architect/engineer, the system calculates the consequences and fleshes out the design • And analyzes the results: – – – – cost statics heat transfer light conditions Main benefits • The problem: – In designing buildings there is an enormous amount of detail that needs to be remembered and taken into account – Consequently, errors are often made, leading to costly repairs – Due to the same reason, experimenting with new ideas is time consuming and costly • House Designer aids the architect by taking care of all aspects that are considered ”mechanical” (”all” is long-term goal) – reduces errors – allows quick what-if analyses – automatically produces documentation One view of the system CAD system s-expr User Interface (java) (ca. 75K LOC) xml House Designer code (ca. 288K LOC) Finite element analysis Design++ Costing engine database Lisp (Franz’ ACL) wall types, wall offsets, wall junctions Where doors are needed, door types, door positions, hinge sides, door directions Amount, types and positioning of required electrical fixtures A valid piping layout (water and ventilation), ensuring that the building is possible to construct Number of windows required, types, positions Wheelchair maneouvre space, ensuring that the layout meets government regulations Wall extension, automatically generated in order to cover the sofa Open plan Sofa Why Lisp? • The use of Lisp was a top management decision from the start • The company wanted a system to automate knowledge • The search led to a methodology called Knowledge Based Engineering, and early KBE systems were based on Lisp • The KBE company emphasised the power of Lisp Knowledge Based Engineering • Today KBE has come to mean many things (check wikipedia) • Best analogy is ”object oriented spreadsheet tightly coupled to a CAD-system” • Provides handling of dependencies and recalculates what is implicated by a change, just like a spreadsheet • Lisp projects that seem very similar: • Cells • http://common-lisp.net/project/cells/ • Computed-Class • http://common-lisp.net/project/computed-class/ Lisp based KBE tools • Design++ (recently bought by Bentley Systems) – http://dp.com/ • GDL – http://www.genworks.com/ Examples of rules – how to calculate the area of various objects The area of a window is its width times its height The area of an apartment is the sum of the area of its internal spaces The area of an access balcony section is the area it has as a normal space, plus the sum of its lips Libraries we use • asdf – http://cclan.cvs.sourceforge.net/cclan/asdf/ • zip – http://common-lisp.net/project/zip/ • clsql 3.6.6 – http://clsql.b9.com • Slime – http://common-lisp.net/project/slime/ Libraries we use • cl-utilities – http://common-lisp.net/project/cl-utilities/ • s-xml – http://common-lisp.net/project/s-xml/ • aserve – http://opensource.franz.com/aserve/index.html • expresso 3.1.0 – http://exp-engine.sourceforge.net/ • screamer 3.24.1 – http://clocc.sourceforge.net/clocc/src/screamer/ The problem of essentially cyclic relationships • We have encountered problem domains that are essentially cyclic: there is no natural place to start – positioning of walls, since they are all connected across floors horizontally and vertically – placement of piping in the service shaft – outlay of prefabricated floor elements • Engineers start at an arbitrary place and iterate until they find a good solution • We found we needed backtracking – We also wanted to just start somewhere and get a solution by trial & error The problem of essentially cyclic relationships • The solution was to use Screamer – Ordinary KBE rules create walls based on the ”nominal” borders of spaces – Constraint variables are set up that... • assert that all walls are aligned with the others they meet • assert that certain rooms must have a certain area • assert that certain walls (e.g. in vertical shafts) fit each other vertically • assert that equpment has sufficient wall space The problem of essentially cyclic relationships • All these constraints are expressed as demands for offset on each wall from its ”nominal” line, i.e. as numeric variables • The total set of constraints is handed over to Screamer – Backtracking occurs within what is to us a black box • When Screamer is done, each wall will find its values in a table, and the KBE system proceeds as normal The problem of essentially cyclic relationships • Piping: part of the problem is establishing how many pipes you need • Positioning of piping in the service shaft uses Screamer’s backtracking explicitly in the House Designer code: (either 1 2 ..) The problem of essentially cyclic relationships • Not all constraints are necessarily satisfied • We prioritize them and arrange for the ones with the lowest priority to fail first • House Designer informs the user which constraints failed Some thoughts about using Lisp for this • Highlights of what we most appreciate with Lisp: – interactivity: quick recompile, with a living model. No need to re-run program to reach same state – the break-loop: debugger with restarts – reader macros, allowing us to customize the syntax of the tool to our liking Modified syntax New syntax, defined by means of a reader macro Original syntax of the KBE tool Some thoughts about using Lisp for this • What we most like (cont.) – advice, to customize the tool further – the ease with which one can examine the lisp image and find out how things work – handler-bind • Lisp has never been a problem, neither regarding lack of functionality/libraries nor getting the necessary people Users • One of our sister companies uses House Designer for statics reports – That branch of the science of mechanics concerned with forces acting on bodies in equilibrium • Another sister company is using it to establish consequences of modified governmental regulations • We are in the process of delivering House Designer to a construction company in the EU Questions?