Explore chapters and articles related to this topic
C++ and Objective C
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
Scope is the area of a program in which the name of a variable, function, or object is visible. C++ and Objective C offer three kinds of scope: global, local, and class. Global scope is done just as in C, by defining the variable outside of any function or class scope. The static modifier can be used to limit global scope to a single file. Local scope is provided for automatic variables (those defined within functions). Class scope is provided for data members of a class, and encompasses all of the methods of the class.
Structured Programming with Python
Published in David E. Clough, Steven C. Chapra, Introduction to Engineering and Scientific Computing with Python, 2023
David E. Clough, Steven C. Chapra
So, our first and important observation is that variables defined within functions cannot be seen outside the function; whereas, variables outside functions in the main script can be seen inside functions. The former are said to have local scope and the latter global scope. This observation excludes function arguments which reference variables outside the function and return results.
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
In most cases the scope of a variable is the block of code encompassed by the innermost pair of curly braces that contain the variable’s declaration. A variable exists only within its particular scope and ceases to exist (i.e., is no longer accessible to the rest of the program) when it goes out of scope. The listing below illustrates this point.
Streamflow prediction in ungauged basins located within data-scarce areas using XGBoost: role of feature engineering and explainability
Published in International Journal of River Basin Management, 2023
Lastly, after observing the model performance in one of the target catchments (North Fork Cache Creek), we decided to add a physical constraint based on a simplified format of water balance equation to XGBoost predictions to create XGBoost 4 (see Eq. 3). However, we acknowledge that this is not an appropriate approach for prediction in ungauged basins because the model performance is not measurable and observable in a truly ungauged catchment. Thus this fourth scenario was performed only as an experiment to potentially gain some more insights into the modelling procedure and performance. We also acknowledge that the appropriate way for adding a physical constraint to a model would be changing the source code of the model and applying the constraint during both fitting the model in the reference catchments and prediction in the target catchments. Currently, XGBoost provides a mechanism for adding only monotonic constraints to a model and manipulating the source code of XGBoost for adding our constraint to the model was beyond the scope of this study. Thus we only apply the constraint in the target catchments after streamflow has been predicted by XGBoost. where IT represents initial storage.
Scheming preventive maintenance assignments for mass rapid transit (MRT): Taoyuan Metro MRT system
Published in Engineering Optimization, 2023
Shang-Yao Yan, Jieh-Haur Chen, Andina Mugi Utami, Ting-Yo Young, Hsi-Hsien Wei
This research proposed two heuristic algorithms using the C++ programming language and CPLEX mathematical programming software to determine the locations of MRT maintenance bases and the scope of preventive maintenance. With the considerations of practical emergency repair time and site space requirements, and their relevant constraints, Heuristic Algorithm I can deal with basic example tests and sensitivity analysis, and Heuristic Algorithm II is developed to solve more complex problems if demands increase. The results for Scheme A illustrate that the total number of sites is 28, and the site cost is estimated at NT$ 13,058,320. The results also indicate that the total operating cost is NT$ 239,120,654.13, the total travel cost is NT$ 13,721,308.48, the maintenance cost is NT$ 213,341,025.65 and the running time is 3370.82 s. The sensitivity analysis suggests that, when site costs decrease, the total number of sites increases, but this causes the travel costs to decrease, and vice versa. The findings also show that if staff salaries decrease, the expense costs for the site and maintenance travel decrease. Greater direct rates result in an increase in travel costs as well as the overall operating costs. The optimal decision supports an increase in the number of maintenance bases. Adjustments made to the MRT direct rate do not affect other costs extensively. The effects of site cost and travel time create complex scenarios that may have an unfavourable influence but are still within a reasonable range.
Does Engaging in Data Philanthropy Impact Business Value?
Published in Information Systems Management, 2023
Jordana J. George, Jie Yan, Dorothy E. Leidner, Pranjal Awasthi
In addition, we added three variables that are not revealed in the literature review but salient in the coding process. They are location, sector, and attention focus. Location is a categorical variable and is measured by the geographical locations of the DP recipients. Some DP announcements only involved recipients in one location while others had recipients worldwide. This variable hence reflects the scope of the DP initiatives. A total of four locations were identified through the coding process including Africa, coded as “1,” UK, coded as “2,” US, coded as “3,” and NA (location information not disclosed in the announcements), coded as “4.” The sector control variable helps differentiate the main industry in which a firm operates. We obtained the sector data from the North American Industry Classification System (NAICS) database and coded all the donor firms into six sectors including 1) Construction, 2) Finance, Insurance, and Real Estate, 3) Manufacturing, 4) Pharmaceutical, 5) Services, and 6) Transportation, Communications, Electric, Gas, and Sanitary Services.