Explore chapters and articles related to this topic
Object-Oriented Programming for Decision Systems
Published in Robert M. Peart, R. Bruce Curry, Agricultural Systems Modeling and Simulation, 2018
Dynamic binding is the ability to determine what method to call at run time rather than resolving the call at compile time. Frequently, the specific receiver class of the message will not be known until run time, so which method will be invoked cannot be determined until then (Ege, 1992). Thus we say there is a dynamic or late binding between the message and the method used to respond to the message, in contrast to early binding in traditional procedural languages such as Fortran or C. This feature allows references to generic objects during compilation, with the run-time behavior of the system determined by the actual (subclassed) objects that are active in the system at the time. Dynamic binding is an extremely powerful tool for defining at a generic level the specific types of behavior a class of objects must provide. Dynamic binding provides an excellent mechanism for defining system-level interfaces for simulation objects, with specific behaviors appropriate to each subclass invoked during program execution.
C++ and Objective C
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
Binding refers to the association of a function call or message to the actual code to execute. Object-oriented languages fall into two camps, static binding and dynamic binding. Dynamic binding means deferring the decision about what code is executed for a given message until run-time. The class of the receiving object is not determined until the time the message is sent, so the code that is executed can be determined by the class of the receiver. Static binding determines the code to execute at compile time, based on the type of the variable used to message the receiving object. Pointer variables allow the type of the receiving object to differ from the type of the pointer used to send the message. Static binding is faster and safer, since it resolves the binding question at compile-time, rather than run-time. Dynamic binding is more flexible, and is better able to support polymorphism, a fundamental OO principle.
Extensible Markup Language Basics
Published in Giovanni Bartolomeo, Tatiana Kováčiková, Identification and Management of Distributed Data: NGN, Content-Centric Networks and the Web, 2016
Giovanni Bartolomeo, Tatiana Kováčiková
The for clause is used to let the XQuery processor iterate through a sequence of nodes. These clauses can be nested. The keyword let binds a variable to a value. The value may be a node or an atomic value, such as a string literal, a numeric literal, or a typed literal.* These values are referred to as bindings. Using variables is a convenient way to simplify an expression and make it more readable; variables also boost performances when the query is evaluated. However, the usual trade-off between memory (i.e., number of variables) and execution time has to be considered when designing nontrivial queries. Where is an optional clause that allows one to define conditions to filter out nodes. The return statement concludes a query and specifies what has to be returned. A query based on an XPath expression normally returns a sequence of nodes; however, using FLWOR expressions, the output is more flexible and the query may also return documents built on the fly. In the latter case, curly brackets are used to distinguish what has to be returned verbatim from what has to be evaluated; expressions inside curly brackets (enclosed expressions) are always evaluated, and the result is concatenated to the rest of text appearing in the return clause. For example, the query (: Assigns a value to a variable. The doc() function selects a document by name :) declare variable $aDocument := doc("sample-document.xml"); (: Following is the actual query :) for $text in $aDocument/note/text where $text/@number > 2 return <note> {$text} <author>Alice Smith</author> </note>
FERMI: Fusion Energy Reactor Models Integrator
Published in Fusion Science and Technology, 2023
V. Badalassi, A. Sircar, J. M. Solberg, J. W. Bae, K. Borowiec, P. Huang, S. Smolentsev, E. Peterson
The FERMI project uses and develops preCICE for coupling of the multiphysics engineering tools. The coupling library preCICE adopts a peer-to-peer approach to code coupling. Figure 6 shows a schematic of the coupling interface of preCICE. The green box in the middle represents the coupling library with included features such as coupling schemes (explicit and implicit coupling with subcycling, as well as serial and parallel), data mapping schemes (nearest neighbor, nearest projection, and radial basis functions), and communications (consistent and conservative). To couple a solver (shown in blue and red boxes) through the preCICE libraries, some function calls must be made to the library using a piece of code called an adapter (green objects). The adapter is written in the same language as the code being coupled, and it depends mainly on the characteristics of the code coupled rather than preCICE. This makes preCICE a largely nonintrusive coupling platform, ideal for partitioned multiphysics simulations. Adapters for some open-source codes (OpenFOAM, CalculiX, etc.) are already available through preCICE whereas those for in-house solvers or other commercial solvers can be written. preCICE is written in C++ with additional bindings for C, Fortran, Python, and Matlab. In this section, after a brief description of the plasma physics and neutronics coupling to provide a starting point for the engineering analysis, some of the new enhancements of the preCICE software are presented: DIABLO-OpenFOAM coupling for FSI and CHT and the HIMAG adapter.
Optimization of reliable cyclic cable layouts in offshore wind farms
Published in Engineering Optimization, 2021
The master problem, the subproblem, and Algorithm 1 are implemented in Python 3.6, using the GUROBI 8 Python bindings for defining and solving the (integer) linear programs. The algorithm is implemented such that the paths are generated in parallel in the inner loop (see Section 3.4). This is accomplished with the Python multiprocessor library, starting parallel instances of the GUROBI solver in separate processes. Random choices for parameters are implemented such that they are evaluated in a deterministic order, and, with the random generator initialized by a seed, such that they are reproducible. Each instance of the subproblem, as well as the master problem, are solved to optimality. An upper bound on the number of outer iterations is applied as the stopping criterion in Algorithm 1.
A Formal Modeling Framework for the Implementation of Gaze Guiding as an Adaptive Computer-Based Job Aid for the Control of Complex Technical Systems
Published in International Journal of Human–Computer Interaction, 2020
Benjamin Weyers, Barbara Frank, Annette Kluge
The following description assumes a deeper understanding of the syntax and semantics of colored Petri nets. For more information, please refer to (Girault & Valk, 2013) or (Jensen, 2013). For the present work, reference nets are used as a specific type of colored Petri net (Kummer, 2002). Reference nets offer unique modeling capabilities for describing control structures, such as data objects and instances of reference nets as objects. Reference nets are supported by a Java-based simulator called Renew (Kummer et al., 2004), which supports the execution of nets as well as bindings to Java code. Besides the use of data objects (e.g., Java objects if Renew is used), reference nets support synchronous channels, which define linking of transitions: linked transitions are fired simultaneously if all linked transitions are enabled. This mechanism is additionally used by Renew to call Java methods from the reference net and vice versa. This mechanism is used to integrate a generated reference net into the runtime system presented in Section 4.5. Furthermore, the inscription language for reference nets offers the specification of guard conditions to control the activity of transitions by Boolean expressions, including the possibility to specify delays for the firing of transitions, which is used for control of gaze guiding tools.