From Engineer to Alchemist, There and Back Again: An Alchemist Tale
Upcoming SlideShare
Loading in...5
×
 

From Engineer to Alchemist, There and Back Again: An Alchemist Tale

on

  • 440 views

When computer science meets (bio)chemistry, a new world of possibilities emerges. Taking inspiration from mechanisms that exist in nature, and empowering them with the magic of computation, engineers ...

When computer science meets (bio)chemistry, a new world of possibilities emerges. Taking inspiration from mechanisms that exist in nature, and empowering them with the magic of computation, engineers become alchemists: they create new worlds, ruled by their own (bio)chemical rules. We will call such virtual worlds"computational ecosystems". In this talk we introduce Alchemist, a simulator developed by our research group in order to let us experiment with this complexity. Alchemist takes inspiration from chemical simulators and ABMs, trying to grab the best of both worlds by providing a fast, reliable and extensible framework. We will have a flyby of the simulator features, showing some case studies: crowd steering, crowd evacuation, morphogenesis, anticipative adaptation. The final part of the talk will frame the future activities, offering a pool of opportunities to those interested in this research area

Statistics

Views

Total Views
440
Views on SlideShare
440
Embed Views
0

Actions

Likes
1
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

From Engineer to Alchemist, There and Back Again: An Alchemist Tale From Engineer to Alchemist, There and Back Again: An Alchemist Tale Presentation Transcript

  • SAPERE Self-aware Pervasive Service EcosystemsFrom Engineer to Alchemist, There and Back Again: AnAlchemist TaleDanilo Pianini – danilo.pianini@unibo.itAlma Mater Studiorum—Universit`a di BolognaCesena, May 8th, 2012Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 1 / 46
  • Outline Do or do not, there is no try.1 SimulationDefinitionsModelsWhen it’s useful?2 AlchemistSAPERE backgroundComputational modelEngine and architectureCase studiesPerformance3 DevelopmentDevelopment modelContributorsFuture activitiesDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 2 / 46
  • SimulationSimulationDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 3 / 46
  • Simulation DefinitionsScientific MethodTraditional science workflow [Parisi, 2001]Traditional scientific methodidentificationdirect observationtheories / hypothesisempirical observationquantitative analysisvalidation / invalidationDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 4 / 46
  • Simulation DefinitionsDefinition of SimulationA new way for describing scientific theories[Parisi, 2001]Simulation is the process with which we can study the dynamicevolution of a model system, usually through computational tools[Banks, 1999]Simulation is the imitation of the operation of a real-world process orsystem over timeDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 5 / 46
  • Simulation ModelsSimulation Requires a ModelM. Minsky – Models, Minds, MachinesA model (M) for a system (S), and an experiment (E) is anything to whichE can be applied in order to answer questions about S.Representation / abstractionFormalisationAggregation, Simplification, OmissionBuilding a model...How complex should be the model?Which assumptions should be done?Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 6 / 46
  • Simulation ModelsFrom Model to Simulation. . .Computer simulationModels are designed runnable processesSimulation creates a virtual laboratorycontrolled conditionsit’s easy to modify the experiment (variables, parameters, etc.)Simulations imitate the operations of the modelled processgeneration of an artificial evolution of the systemDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 7 / 46
  • Simulation Models. . . and BackDeductions on the real system representedEvaluation of theories about the modelModel validation [Klugl and Norling, 2006]if the data is reliable;if prediction doesn’t match the observed behaviour do not match⇒ the model must be revisedDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 8 / 46
  • Simulation When it’s useful?Why do we Need Simulations?[Parisi, 2001, Klugl and Norling, 2006]The real system cannot actually be observedThe time scale of the real system is too small or too large forobservationThe original system doesn’t yet exist (or not anymore)The system is too complexDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 9 / 46
  • AlchemistAlchemistDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 10 / 46
  • Alchemist SAPERE backgroundThe SAPERE Projecthttp://www.sapere-project.eu/SAPERE (Self-aware Pervasive Service Ecosystems) is an EU STREPproject under the FP7 FET Proactive Initiative: Self-Awareness inAutonomic Systems (AWARENESS)The objective of SAPERE is the development of a highly-innovativetheoretical and practical framework for the decentralized deploymentand execution of self-aware and adaptive services for future andemerging pervasive network scenariosDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 11 / 46
  • Alchemist SAPERE backgroundSAPERE WorldLSA SpaceLSALSALSALSAeco-lawEngineSoftware servicesSAPERE Nodeeco-law activationSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeSAPERENodeDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 12 / 46
  • Alchemist SAPERE backgroundSimulation of a SAPERE environmentThe role of simulationEmergence cannot be fully designedIt’s crazy to deploy a whole ecosystem without any testFist class abstractionsDynamic environmentDifferent, mobile, communicating nodesProgrammability through a set of chemical-like lawsContinuous Time Markov Chain (CTMC) modelAutonomous agentsDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 13 / 46
  • Alchemist SAPERE backgroundTwo approachesClassic ABM modellingHigh flexibilityTopology as first-class abstractionDynamics explicitly modelledNo native support for CTMC modelChemical inspired modellingNatively CTMCVery fast and reliable algorithms exist in literatureVery limited topology: multicompartment at bestOnly classic reactions can change the world status: limited flexibilityDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 14 / 46
  • Alchemist Computational modelAlchemist simulation approachBase ideaStart from the existing work with stochastic chemical systemssimulationExtend it as needed to reach desired flexibilityGoalsFull support for Continuous Time Markov Chains (CTMC)Support for differently distributed events (e.g. Triggers)Rich environments, with obstacles, mobile nodes, etc.More expressive reactionsFast and flexible SSA engineDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 15 / 46
  • Alchemist Computational modelEnriching the environment descriptionEnvironmentNodeReactionsMoleculesAlchemist worldThe Environment contains and links together NodesEach Node is programmed with a set of ReactionsNodes contain MoleculesEach Molecule in a node is described with a ConcentrationDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 16 / 46
  • Alchemist Computational modelExtending the concept of reactionFrom a set of reactants that combine themselves in a set of products to:Number ofneighbors<3NodecontainssomethingAny otherconditionabout thisenvironmentRate equation: how conditionsinfluence the execution speedConditions Probability distribution ActionsAny otheractionon thisenvironmentMove a nodetowards...Changeconcentrationof somethingReactionIn Alchemist, every event is an occurrence of a ReactionDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 17 / 46
  • Alchemist Engine and architectureSSA AlgorithmsSeveral SSA exist, they follow the same base schema [Gillespie, 1977]:1 Select next reaction using markovian rates2 Execute it3 Update the rates which may have changedDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 18 / 46
  • Alchemist Engine and architectureDo the math: reaction speedConsider a chemical reaction in the form:A + Bµ−→ CThe probability that this reaction will trigger depends on:1 Number of molecules A and B: the higher, the higher the probabilitythose molecule will encounter and react2 µ, a speed coefficient for the reactionWe define the propensity of a reaction as its speed in a precise instant oftime asaµ = µ[A][B]Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 19 / 46
  • Alchemist Engine and architectureDo the math: next reaction choiceIf we assume every reaction is a Poisson process, the probability for it tobe the next one is:P(next = µ) =∞0P(µ, τ)dτ =∞0aµe−τ j ajdτ =aµj ajDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 20 / 46
  • Alchemist Engine and architectureDo the math: next reaction timeWe can also compute the next time of occurrence:P(τ)dτ =jP(µ, τ)dτ =jaj e−τ j ajdτjaj = λ −→ λe−λxF(x ≤ t) =t−∞λe−λxdx = −e−λtt−∞= e−λtNow, given a uniformly distributed random r, it’s possible to compute it’sequivalent for the desired distribution:e−λt= r ⇒ t =− ln (r)λDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 21 / 46
  • Alchemist Engine and architectureExisting algorithmsDirect method1 Compute propensity for each reaction2 Select next reaction probabilistically3 Execute itDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 22 / 46
  • Alchemist Engine and architectureExisting algorithmsA+B→CB+C→D E+G→AD+E→E+F F→D+GDirect method + Dependency graph1 Compute the dependencies among reactions2 Compute propensity for each reaction3 Select next reaction probabilistically4 Execute it5 Update propensities only for potentially involved reactions6 Goto 3Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 23 / 46
  • Alchemist Engine and architectureExisting algorithmsNext Reaction1 Compute a putative execution time for each reaction2 Store reactions in a binary heap3 Pick the next reaction4 Execute it5 Compute putative times only for potentially involved reactions6 Goto 3Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 24 / 46
  • Alchemist Engine and architectureExisting algorithms[Slepoy et al., 2008]1 Compute propensities2 Split the reactions in groups by their propensity3 Throw randoms until a reaction in a group is selected4 Execute it5 Update propensities only for potentially involved reactions6 Goto 3Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 25 / 46
  • Alchemist Engine and architectureMore flexibility!What they miss is what we addedSupport for instantaneus events (∞ Markovian rate)Reactions can be added and removed during the simulationSupport for non-exponential time distributed events (e.g. triggers)Dependencies among reactions are evaluated considering their“context”, speeding up the update phaseDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 26 / 46
  • Alchemist Engine and architectureSmart data structures ⇒ bleeding edge performances2.04 43.717.32 15.51 028.91 04.20 09.10 010.10 0inf0 0A+B→CB+C→D E+G→AD+E→E+F F→D+GNext Reaction efficient structures made dynamicDynamic Indexed Priority QueueAllow to access the next reaction to execute in O(1) timeWorst case update in log2 (N) (average case a lot better)Extended to ensure balancing with insertion and removalDynamic Dependency GraphAllows to smartly update only a subset of all the reactionExtended with the concept of input and output contextDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 27 / 46
  • Alchemist Engine and architectureModular structureEnvironmentUser InterfaceAlchemist languageApplication-specific Alchemist Bytecode CompilerEnvironment description in application-specific languageIncarnation-specific languageReporting SystemInteractive UIReaction ManagerDependency GraphCore EngineSimulation Flow Language ParserEnvironment InstantiatorXML BytecodeDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 28 / 46
  • Alchemist Engine and architectureSome Features in shortParallel executorApproximate Stochastic Model CheckerParallelised engineAlchemist2BlenderPVeStA integrationDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 29 / 46
  • Alchemist Case studiesCrowd evacuationEXIT 1EXIT 2Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 30 / 46
  • Alchemist Case studiesCrowd steeringDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 31 / 46
  • Alchemist Case studiesAdaptive DisplaysDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 32 / 46
  • Alchemist Case studiesSimple Morphogenesis proof of conceptDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 33 / 46
  • Alchemist Case studiesMorphogenesis of a Drosophila MelanogasterDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 34 / 46
  • Alchemist Case studiesAnticipative adaptation051015202530354045 0510152025303540450102030405060datald.log using 2:3:40102030405060Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 35 / 46
  • Alchemist Case studiesRealistic pedestrianssee the video...Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 36 / 46
  • Alchemist PerformanceTestbedWe realised the same crowd-steering application for both Alchemistand RePast, in order to evaluate the performance gap (if any)Source code for RePast and standalone Alchemist applicationavailable athttp://www.apice.unibo.it/xwiki/bin/view/Alchemist/JOSWe choose a simplified use case which allows simulation in RePastwithout any change in its engineThis actually cripples out the most important Alchemist optimizationfor complex environment (the dependency graph)Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 37 / 46
  • Alchemist PerformanceResults05010015020025030035040045050050 100 150 200 250 300 350 400 450 500Executiontime[s]Number of agentsPerformance comparison with RepastRepast AlchemistDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 38 / 46
  • DevelopmentDevelopmentDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 39 / 46
  • Development Development modelDistributed developmentAlchemist is a training ground for some good team development practicesLinux kernel-like development modelJavaXTextMercurial DCVSBitbucket web-based code hostingMavenJUnitSource is released under GPLDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 40 / 46
  • Development ContributorsPeople involvedMichele Bombardi (Done)Realistic pedestriansChiara Casalboni (Done)Realistic pedestriansFrancesca Cioffi (Done)Further experiments with Alchemist-SAPEREDavide Ensini (Done)Approximate Stochastic Model Checker improvementEnrico Galassi (Done)Alchemist-SAPERE high level languageEnrico Gualandi (Ongoing)Alchemist-SAPERE languages reviewDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 41 / 46
  • Development ContributorsPeople involvedLuca Mella (Done)Tools for social network analysisAlessandro Montalti (Done)MS-BioNet to AlchemistXML translatorLuca Nenni (Done)Alchemist2BlenderEnrico Polverelli (Done)Gradient based patternsMichele Pratiffi (Done)Image importer for AlchemistGiacomo Pronti (Done)SAPERE incarnation main authorLuca Ricci (Ongoing)Map importer for AlchemistAndrea Vandin (IMT Lucca)PVeStA integrationDanilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 42 / 46
  • Development Future activitiesThere is a lot of work to do!MS-Bionet compatibility layerAlcheGRIDAlchemist2Blender improvementOpenStreet Map importer and Google Map importerBlender Integration improvementGnuplot integrationCellML / SBML to AlchemistXMLChemistry Incarnation reviewAlchemist for Bio DSLRealistic biological gradientsGPX tracks loaderRDF to Alchemist-SAPERE translatorThese are examples, if you have something in mind, be proactive!Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 43 / 46
  • Development Future activitiesBibliography IBanks, J. (1999).Introduction to simulation.In Farrington, P., Nembhard, H. B., Sturrock, D. T., and Evans,G. W., editors, Proceedings of the 1999 Winter SimulationConference, pages 7–13.Gillespie, D. T. (1977).Exact stochastic simulation of coupled chemical reactions.Journal of Physical Chemistry, 81(25):2340–2361.Klugl, F. and Norling, E. (2006).Agent-based simulation: Social science simulation and beyond.Technical report, The Eighth European Agent Systems SummerSchool (EASSS 2006), Annecy.Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 44 / 46
  • Development Future activitiesBibliography IIParisi, D. (2001).Simulazioni - La realt`a rifatta al computer.Societ`a editrice il Mulino.Slepoy, A., Thompson, A. P., and Plimpton, S. J. (2008).A constant-time kinetic Monte Carlo algorithm for simulation of largebiochemical reaction networks.The Journal of Chemical Physics, 128(20):205101+.Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 45 / 46
  • SAPERE Self-aware Pervasive Service EcosystemsFrom Engineer to Alchemist, There and Back Again: AnAlchemist TaleDanilo Pianini – danilo.pianini@unibo.itAlma Mater Studiorum—Universit`a di BolognaCesena, May 8th, 2012Danilo Pianini (UniBo) An Alchemist Tale Cesena, May 8th, 2012 46 / 46