text:
XRX

XRX or XForms/REST/XQuery is a simple and elegant web application architecture that leverages modern declarative and functional programming systems. XRX allows the developer to create rich-client web applications that perform complex functions without the need for middle-tier objects, relational databases or client-side JavaScript.

XRX is based on three standards:

 * 1) XForms on the client
 * 2) REST interfaces
 * 3) XQuery on the server

These three standards have been created by the W3C standards organization and represent their vision of the future of web application development. For discussions on alternate definitions of the XRX web application architecture see /What is XRX/.

This wikibook is intended as an example that specifically uses all three of these technologies to create small applications that work together.

Related Wikibooks
There are two sibling Wikibooks that this Wikibook is designed to complement.

The XForms Tutorial and Cookbook Wikibook has over 90 sample XForms application to help you become familiar with the XForms model and XForms controls. Although XForms has only 21 elements they can be combined in many different ways to build very complex web clients.

The XQuery Wikibook is focused on using the XQuery language with almost all of the sample programs using the eXist native XML database.

The XForms Wikibook has minimal dependencies on which server you use to host your web forms. Almost all of the XQuery Wikibook does not assume any prior knowledge of XForms. This book, on the other hand, assumes that you will be using both XForms and XQuery to create a complete web application development environment.

Subversion Repository
Many of the example programs in this cookbook are now being stored in a Subversion repository on GoogleCode. The URL for the XRX GoogleCode is here:

http://code.google.com/p/xrx

If you are using an IDE with a Subversion client such as Eclipse or oXygen, the URL for the repository is:

https://xrx.googlecode.com/svn/trunk

If you would like a read-only copy, you can use the non-SSL URL

http://xrx.googlecode.com/svn/trunk

Introduction

 * 1) /Introduction/ - an overview of the goals of this Wikibook and the intended audience
 * 2) /Benefits of XRX/ - an analysis of the technical benefits of the XRX web application architecture
 * 3) /XRX Application Server/ - how XRX has allowed the XQuery language to move from a database language to an application language
 * 4) /Building your First XRX Application/ - some suggestions on how to get started building your first XRX application
 * 5) /Background Technologies/ - a summary of the background technologies you will use to build XRX applications
 * 6) /Patching you Browser to Support XForms/ - how to add functionality to support the W3C XForms standards
 * 7) /XSLTForms and eXist/ - getting XSLT forms to work with eXist

Common Patterns

 * 1) /Application Modularity/ - XRX applications can be managed and reused if they have modular structure
 * 2) /Data Encapsulation/ - XRX applications contain and manage their own data sets and provide XQuery functions as interfaces
 * 3) /Standard Views/ - XRX applications contain standardized views of their data
 * 4) /Searchability/ - XRX applications provide tools to search their own data and interfaces to allow it to participate in site-wide search functions
 * 5) /Code Table Management/ - XRX applications manage code tables (selection lists) and make it easy for non-programmers to maintain these codes
 * 6) /Server Field Validation/ - XRX can use server-side XQuery to validate a field
 * 7) /Breadcrumb Navigation Bar/ - XRX applications are nested in a hierarchical structure an navigation breadcrumbs are context aware

Sample Applications

 * 1) /Configuration File Editor/ - a simple file, single user XML configuration file editor using XForms and eXist
 * 2) /Dictionary Editor/ - a simple round-trip create/update edit using XForms and eXist
 * 3) /Regular Expression Builder/ - a demonstration of using regular expressions in XQuery
 * 4) /Autoincrement File ID/ - save an instance from a form into a collection and have the id automatically created by the server
 * 5) /Move a Resource/ - simple resource move utility
 * 6) /Save File Dialog/ - saving a file to a collection similar to a save dialog panel
 * 7) /Login and Session Management/ - a login panel and methods of authenticating users
 * 8) /File Locking/ - strategies to prevent multiple users from overwriting each others updates
 * 9) /Selection List Generator/ - a tool to generate selection lists from code tables
 * 10) /Glossary Term Editor/ - a tool to manage specialized business vocabularies
 * 11) /FAQ Manager/ - a tool to manage frequently asked questions
 * 12) /Detecting Duplicates/ - checking for duplicates as you type
 * 13) /Data Element Editor/ - a tool to manage ISO/IEC 11179 data elements
 * 14) /Selection List Management/ - tools to manage selection list codes in your XForms
 * 15) /Customizing Selection Lists/ - customize the selection list based on role or other session variable
 * 16) /Table Sorting/ - customization of table sort order
 * 17) /NIEM Services/ - tools to create NIEM web services
 * 18) /Product Ratings/ - allows users to assign a rating of one to five stars to an item in a collection
 * 19) /Business Rules Template/ - a sample of a simple business rules template
 * 20) /Metadata Shopper/ - a shopping cart tool for your metadata elements
 * 21) /Subset Generator/ - a program that generates a subset of a metadata registry that is imported into an XML Schema
 * 22) /XForms Generator/ - convert an XML Schema directly into an XForms application
 * 23) /XForms Instance Generator/ - convert an XML Instance directly into an XForms application
 * 24) /Large XForms Generator/ - create large XForms using a single REST parameter
 * 25) /User Manager/ - track users and manage their login attempts, session timeouts and roles
 * 26) /Map Navigation/ - add map navigation to your XRX applications

XRX Patterns

 * 1) /Content Routing/ - inspecting the content of an XML document to apply save rules
 * 2) /URL Rewriting/ - allow URIs to reflect the logical structure of a service, not the collection structure of the database

Related Technologies

 * 1) LAMP - Linux, Apache, MySQL and PHP
 * 2) AJAX - Asynchronous JavaScript and XML
 * 3) Adobe Flex - Adobe's system for building rich-client interfaces (Now Apache Flex)
 * 4) Microsoft Silverlight - Microsoft's strategy for putting XML in the browser (Discontinued)

title: XRX


text:
C++ Programming/Code/Standard C Library/Functions/atof

atof
The function atof converts str into a double, then returns that value. str must start with a valid number, but can be terminated with any non-numerical character, other than "E" or "e". For example,

results in x being set to 42.0.

 * Related topics: atoi - atol - strtod (Standard C I/O) sprintf

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
XRX/Save File Dialog

Motivation
You want to allow the user to save form data into a named file in an eXist collection that will not conflict with existing files.

Method
When the user selects a Save button we will use switch/case to open up a save dialogue. In this dialogue we will list all of the current files in a collection and allow the user to create a new file with a name that does not conflict with any existing file names. If the user selects a file from the list, we will replace the current file name with that file name.

Using the get-child-resources Function
eXist provides a function that lists the files in a collection. You can get a sorted list of all the files in a collection with the following XQuery

When executed, this XQuery will return the files in a collection. For example here is the URL of an XQuery execution with the collection parameter passed as an argument:

list-files-in-collection.xq?collection=/db/rss

We can then use this XML listing to display a list of existing files and allow the user to select a name that is not on this list.

Sample Program

Discussion
Back: Move a Resource • Next: Login and Session Management

title: XRX/Save File Dialog


text:
C++ Programming/Code/Standard C Library/Functions/atoi

atoi
The atoi function converts str into an integer, and returns that integer. str should start with a whitespace or some sort of number, and atoi will stop reading from str as soon as a non-numerical character has been read. For example:

All five of the above assignments to the variable i would result in it being set to 512.

If the conversion cannot be performed, then atoi will return zero:

A complete C++ implementation of atoi.

 * Related topics: atof - atol (Standard C I/O) sprintf


text: User talk:24.20.21.140

title: User talk:24.20.21.140


text:
Cookbook:Cannoli

Cannoli are sweet Italian pastries, also known as cream horns. They consist of a fried pastry shell in the shape of a tube, filled with a sweet cream and cheese mixture.

Ingredients

 * Cannoli shells (store-bought or homemade)
 * 2 tablespoons ricotta cheese
 * 1 tablespoon sugar
 * 1 tablespoon whipped cream
 * 1 tablespoon chocolate chips
 * ½ tablespoon icing

Procedure

 * 1) Prepare the cannoli shells if you are making them yourself.
 * 2) Combine the ricotta and sugar. Fold in the whipped cream and chocolate chips.
 * 3) Fill shells with the ricotta mixture. A piping bag works well here.
 * 4) Cool cannoli in the fridge before serving.

Notes, tips, and variations

 * Replace the chocolate chips with dried fruit.

title: Cookbook:Cannoli


text:
User:Physis

Formatted and slightly clarified
Category theory

Other projects

 * Physis on Wikipedia
 * Physis on Wikimedia Commons

title: User:Physis


text: User talk:67.165.16.128

title: User talk:67.165.16.128


text:
DirectX/9.0/Direct3D

Direct3D is the most advanced and complex component of DirectX. It deals with one of the most complex areas of modern computing - graphics. It relies heavily on mathematics, specifically Trigonometry and Algebra.

Prerequisites
Understanding the majority of Direct3D requires understanding some mathematical concepts; including Vectors, Matrices, and Trigonometry. While you will be able to do much of the basics in developing for DirectX without these, they become important later on and most people are generally unable to understand why we are doing something.

Goals
This section of the DirectX book will (hopefully) teach you the basics of Direct3D, such as initialization, vertex and index buffers, cameras, models, textures, lights, and particles. Throughout the book, we will implement a benchmarking tool to test our understanding.

Resources
These files will be used to provide a framework for our benchmark application:

 * Framework main.cpp

Contents

 * Initialization[[File:75%.svg]]
 * Primitives and Rendering[[File:25%.svg]]

title: DirectX/9.0/Direct3D


text:
DirectX/9.0/DirectSound

Direct Sound
If you can use Direct3D; DirectSound is a breeze. There aren't as many errors that can occur; and you can basically skip the initialization because it's almost the same.

title: DirectX/9.0/DirectSound


text:
User talk:Racheles

Introduction

Teachers as well as students need someone to listen to them and to help them with problems that they may be facing. A mentor is defined as a trusted counselor or guide. New teachers are faced with many overwhelming, new experiences that are why having a mentor is effective not only for the growth of the teacher but also for the growth of the school. What do mentors bring to the classroom? “The mentor is supposed to just be there when you need her for whatever. They [the novice teachers] know that, and I establish that with them at the very beginning, that I’m here to help you in any capacity but what I do is make suggestion. And I tell them, if you don’t follow them its all right. Maybe what I suggest is something that you feel that you can’t use. –Terri, mentor teacher in Los Angeles” (Nemser and Parker).Mentors may not be able to fix the entire problem that may arise for new teachers but their suggestions make a difference. Someone close to a mentor would be a support teacher. “I see myself as someone who thinks with the clients I’m working with and can maybe help turn their thinking toward paths of growth that they think would be useful for themselves… There’s also a little bit of me in their thinking…So I make suggestion and help people to look at possibilities, but id never force them to take that road.-Pete, support teacher in Albuquerque (Nemser and Parker). Experienced teachers can become mentors and help new teachers stay positive in the classroom.

What are the benefits of having mentors?

“The chance to “mentor” a new teacher addresses two serious problems in teaching, the abrupt and unsupported entry of novices into the field and difficulty of keeping good, experienced teachers in the classroom” (nemser and parker). According to most professionals having a mentor gets rid of the “sink or swim” mentality. Earlier in the Education institution they would throw teachers to the classrooms right out of school without anyone to guide them in their new experiences. Having a mentor gives the new teacher more support and keeps them learning and growing in their position. “Mentors are to guide the new teachers, to provide assistance, to help them in securing skills-all the things that the teachers are lacking, that they have either not had because they’ve not had any teacher classes and those everyday things that they learn just by virtue of teaching” (Nemser and Patrick).

What are the guidelines for Mentors?

Mentors are important for teachers and the school because they give the support that the teacher needs to keep learning and teaching what they have learned. “Mentor teacher programs utilizing specially trained public school teachers as mentors to provide assistance and professional support to teachers entering the profession and to improve the performance of experienced teachers who are not performing at an acceptable level” (Mentor Teacher Programs). Teachers who have already been teaching for a while already have that security and experience in the classroom that they can share with new upcoming teachers. According to different studies “varying degrees of trauma associated with newness, such that it was equally difficult to begin teaching in a new setting” (Zimpher and Rieger).

The Background of the Mentor program

In 1985-1991 “The Beginning Teacher Assistance Program (BTAP), initiated in 1985 as the first support program for beginning teachers, evolved into a performance assessment required for licensure. BTAP was rescinded by the General Assembly in 1991” (Mentor Teacher Programs). From 1987 to 2000 the General Assembly has been making many new decisions on mentoring for teachers. The Virginia General Assembly appropriated an additional 300,000 for mentor teacher programs and in 2000 there was the Quality Enhancement Act requiring a mentor for every beginning teacher (Mentor Teacher Programs).

Headline text
How do Mentors affect new teachers?

Mentors across the board help new teacher’s everyday in the schools. “Mentor programs help beginning teachers make a successful transition into teaching by relying on the expertise of veterans to provide a clinical, real-world training process” (Mentor Teacher Program). According to the article Mentor Teacher Programs new teachers who are mentored receive higher ratings from their principals, develop better planning skills, handle discipline problems more effectively and conduct more productive classroom discussions. Here is a story of a girl Julia who had the spark to teach but found out that it was harder than she thought “As the school year wore on, Julia wore out. Teaching left her with feelings of disillusionment, shattering her idealism. By June, Julia decided to leave teaching and to pursue another career” (Marge Scherer). Why mentors are important Mentors are important because they offer the new teacher a chance to enjoy what they love doing without becoming overwhelmed by the new stresses faced in the class room. Once the teacher has been there for a while they themselves can help out the new teacher by becoming their mentor.

I think that every teacher should have a mentor beside them giving them advice and support. As we have seen previously it isn’t all about the showing them away around the school and class room, it is also about the emotional support and the needs that the new teacher needs. We all remember when we have started something new and how we were frightened by that fear of the unknown, being a new teacher is the same they are trying to come out on top because they know that this is the career that they want to pursue. Mentors are important they not only support their fellow co-workers but they also allow them to pursue the job that they have dreamed of.

Board of Education (2000).Division of Teacher Education and Licensure. Guidelines for Mentor Teacher Programs for beginning and Experienced Teachers.

Feimann-Nemser, Author's first name initialSharron, & Parker, Michelle (1992). National Center for Research on Teacher Learning. Metoring in Context: A comparison of Two U.S programs for Beginning Teachers.

Zimpher, Author's first name initialNAncy L, & Rieger, Susan R (1988). Mentoring teachers: What are the issues?

Scherer, Marge A Better Beginning. Supporting and Mentoring New teachers.

title: User talk:Racheles


text: Template:Java Programming/UserInterfaceTopics/Nav


text:
User:Arctic.gnome

To read more about me or to get a quick reply, please see my user page on the English-language Wikipedia, where I am most active.

title: User:Arctic.gnome


text:
User talk:168.156.89.198

Join Us!
--Webaware talk 05:34, 6 March 2008 (UTC)

title: User talk:168.156.89.198


text:
Java Swings/Swing Layouts

The layout of components is dictated by the layout manager used. There are 7 layout managers built into Java. Most UIs are built using some combination of them, typically by nesting layout managers. The most commonly used layouts are FlowLayout, BorderLayout and BoxLayout.

BorderLayout

 * Used to arrange components around a center panel.
 * Sizes components to use all available space for their region.
 * North / South components will be as tall as their preferred height and as wide as the width of the component they're in.
 * East / West components will be as wide as their preferred width and as tall as the height of the component they're in minus the preferred heights of the North and South components.
 * Center will use all remaining space in the component after the North / South / East / West components have been sized.

FlowLayout

 * Used to arrange components in a straight horizontal line.
 * If there is not enough space for all the components to fit, they'll be moved to the next line.
 * Components are set at their preferred sizes.

BoxLayout

 * Used to arrange components vertically or horizontally.  is essentially a replacement for   that is more powerful if thats what you're going for. However with great power comes great responsibility... or something like that. The trade off for having more power is you have to do a bit more work, but you can get things to look closer to what you really want. To demonstrate we'll go through several examples.

s come in two basic flavors. Vertical or horizontal. These are represented by the constants,  ,  ,. X/Y_AXIS specify to always layout the components along the X or Y axis of the container. The components are then arranged left to right (X_AXIS) or top to bottom (Y_AXIS). LINE/PAGE_AXIS will do exactly the same thing as X/Y_AXIS assuming the  field of the parent container is left to right oriented. If not, LINE_AXIS will add components from right to left, and PAGE_AXIS will by default align components on the right side of the panel. If you are planning to support locale specific layouts, PAGE_AXIS is the one for you.

Talking about alignments is fun, but lets see a demo. The below demo will create a main window which will allow you to create child windows laid out with the proper alignments.

CardLayout

 * Used to show one component at a time from a set of components. It is like a deck of flash cards, where you show one of the cards at a time, hence the name. You can quickly change which component is shown at any time, e.g., when the user clicks a button.

GridLayout

 * Used to arrange components in an evenly spaced grid.

title: Java Swings/Swing Layouts


text:
Java Swings/Large Examples

Calculator
The example below builds a user interface using multiple nested layout managers, applies listeners and client properties to components, and demonstrates how to create components from the Event Dispatch Thread (EDT).

Main Method
The main method is pretty straight forward.

It creates a new calculator, sets it to exit the program when its closed and then makes it visible. The interesting bit about this code is that it doesn't happen in the main thread. It happens in the event dispatch thread. While in a simple application like this it's enough to simply wrap the whole component creation in an  to push it into the EDT, larger applications need to be careful that they only access UI components from the EDT. Not doing so can cause mysterious deadlocks in applications.

Constructor
The constructor is where the calculator is laid out.

This approach uses inheritance for defining the calculator. Another way of doing it would have been to have a  method which would return a panel laid out as desired. The calculator would then be a controller dictating the behavior of the panels and own the panel all the components were on. While more complex, that method also scales more easily to larger, more complicated UIs. Inheritance has the problem of child classes having the ability to override methods that are currently being called in the constructor of the parent class. If the overridden methods required a field in the child class to be already initialized, you're in trouble. At the time that the method would be called in the parent, the child hasn't been fully initialized yet.

The constructor uses two BorderLayouts to do the layout. The first is for the main panel, the second is to compose the main panel with the error message panel. Also, each of the subpanels in the main panel are built with their own layout managers. This is a good example of building a more complicated UI as a composite of multiple simpler sub-panels.

Listeners
Here we start getting into the fun bits. For each of the buttons we want something to listen for the pushed button. The  class does just that.

We setup a separate listener for each type of button. Numbers, Decimals, Operators and Clear buttons. Each one processes the message associated with that class of button and only that class of button. While that's fine, how do you determine which button in that class was pressed? Well, Swing provides a way of setting arbitrary properties on objects. This is accomplished by the  pair. Below, we tell the difference between the number buttons by which number is associated with the  of the button. Similarly the  does the same, but pulling out its own property.

Building the buttons
Here we can see how the listeners get assigned to the buttons.

First we set the label for the buttons by passing a  to the constructor of the JButton, then we set the property value that we want using   then we add the appropriate action listener to the button. Action listeners are activated when the component takes its intended action. For a  that means being pressed.

Building the panels
Here we show building the number panel.

We want an even grid for the number keys and want them all to be sized the same so we use a  as our LayoutManager. This grid is 4 rows deep and 3 columns wide. Building the operator panel and the clear panel are both done similarly.

Full code for the Calculator
In this "calculator": 4 * 6 = 36, 4 * 9 = 81, 4 * 3 = 9. Error1 in strings: After correcting Error1 in this "calculator": 1 / 3 = 3, 5 / 2 = 0.4, 8 / 4 = 0.5. Error2 in strings: After correcting Error2 in this "calculator": 9 - 6 = -3, 6 - 3 = -3, 8 - 4 = -4. Error3 in strings: Error4 in strings: After removing this strings calculator work correctly. Here you can find the similar calculator running on a web like Java applet, with source code and code review available.

title: Java Swings/Large Examples


text: User talk:220.239.171.194

title: User talk:220.239.171.194


text: User talk:203.199.232.222

title: User talk:203.199.232.222


text:
Introduction to Crochet/Cat blanket

My cat claims ownership of every piece of crochet I make, if she doesn't succeed in shredding it during construction. So in order to pacify the little beast I tempt her away from the yarn balls with this blanket. It's just her size, it's soft, and she can leave her scent all over it. She especially enjoys it when it's laid on the carpet in a patch of sunlight. I don't think it makes the carpet any softer, but she seems to enjoy owning the thing.

Materials

 * Cotton yarn in ecru and Navy blue (amount)
 * 4mm hook (U.S. size G)

Construction
The body of this blanket is the important part and it's as easy as can be: one chain stitch, one double crochet. Wash, rinse, repeat. Work a half double stitch in a contrasting color around the border and do anything you like afterward. I got a little fancy because I had been staring at a book of border patterns and decided to try designing something of my own. So don't be afraid of the border design - it's really just sets of chain stitches and double crochet. If the thing gets frustrating, do a simpler border.

Instructions
Body:
 * Row 1: Begin with ecru yarn. Chain stitch 154 plus a 3 stitch turning chain.
 * Row 2: double crochet, chain stitch. Skip 1, then double crochet and chain stitch again.  Repeat.  At the end of the row make 2 double crochet stitches in succession.  Make a 3 stitch turning chain.
 * Row 3: skip 1, double crochet wrapping around the previous chain, chain stitch. Repeast.  At end of row make two double crochet stitches in succession; the second double crochet goes into the previous turning chain.  Then make a 3 stitch turning chain.
 * Rows 4-72: as row 3.

Border:
 * Part 1: switch to Navy blue yarn. Half double crochet around the entire edge.  Make 1 stitch into each stitch of the rows, 5 stitches into the loose loop at each corner, and 2 stitches into each row along the sides.
 * Part 2: switch back to ecru yarn. Double crochet 3, chain stitch 1; skip 1.  Repeat.  At corners double stitch 2 stitches into each of the 5 corner stitches from the previous row.  Complete 1 circle around the border this way.  Close the loop with with a flat stitch.
 * Part 3:
 * Row motif: chain stitch 3, skip 2 and double crochet wrapping around the chain stitch from the previous row; chain stitch 2, double crochet a second stitch around the same chain stitch; make a picot of 4 chain stitches, close with a flat stitch; chain stitch 2, double crochet a third time around the same chain stitch, chain stitch 3, skip 3, single crochet around the chain stitch. Chain stitch 3, skip 3 and double crochet wrapping around the chain stitch from the previous row; chain stitch 2, double crochet a second stitch around the same chain stitch; make a picot of 4 chain stitches, close with a flat stitch; chain stitch 2, double crochet a third time around the same chain stitch, chain stitch 3, skip 3, single crochet around the chain stitch.  Repeat to end of row.
 * Corner motif: chain stitch 3, skip 1 and double crochet; make a picot of 5 chain stitches and close with a flat stitch, double crochet, chain stitch 3, skip 1 and single crochet. Repeat.
 * Resume row motif for the other 3 rows and corner motif for the other 3 corners.

title: Introduction to Crochet/Cat blanket


text: User talk:196.25.87.66

title: User talk:196.25.87.66


text:
Embedded Control Systems Design/Design criteria

This chapter explains the approach of a design on a system level. Therefore it is necessary to introduce several system criteria; these differ from the technical design criteria because they aren’t reflected in the final design. The four system criteria discussed in this chapter are optimization, design space, robustness and human resources. A list of specific technical design criteria for ECSs is discussed at the end of the chapter.

The inputs of a design team are the requirements. These aren’t predetermined but subject to change during the design process. The majority of the requirements state a minimum or maximum value and not a fixed one (i.e. weight must be below 1 kg, cost must be below €5, …). Therefore the requirements can be thought of as the boundaries of the design space.

Within this design space all feasible solutions exist. Of all these feasible solutions, the designer is interested in the most optimal one. Hence there is need for optimization. Some commonly used ways to achieve this are:
 * Full optimization.
 * Using pareto principle: 20% of the effort of the first method leads to 80% of its goals.
 * Best effort method.
 * Linear programming
 * Multiobjective optimization
 * Model Driven Engineering

Optimization of a design is complicated because:
 * The coupled nature of the technical design criteria: A change in one criterion has an impact on (almost) every other criterion. Hence optimization must be done by simultaneously solving for every criterion, instead of optimizing every criterion apart, one by one.
 * Design criteria aren’t always easy to represent as a numerical value (i.e. How do you define how easy to use an ECS is?)
 * Uncertainties on the requirements and thus insecurities on the design space.

In an ideal case, all requirements are convertible into quantitatively expressed formal representations that the designer can then optimize. However in most real-life scenarios some of the requirements aren’t simply convertible to a numerical value and so the optimization of these requirements is not as straightforward as minimizing or maximizing a value. The computational cost of the optimization is thus not the only factor to be considered. The quantification of design criteria can be more critical and a relatively big uncertainty of this quantification is sometimes inevitable.

Robustness is an important aspect of a system or design. It differs from most design criteria because of the difficulty to quantify or measure it. A system or design is said to be robust when it’s able to deal with uncertainties and variations of its operational environment with minimal damage and loss of functionality. Optimization and robustness can be seen as each others complement. Optimization makes sure that in the operational environment the system works optimal (i.e. minimum cost), robustness must ensure that if, for an unknown reason, the environment changes the system will minimize damage and loss of functionality.

Human resources is also a system-level criterion for a design. The number of personnel that is put into a project determines the time frame of the design. Since this is highly linked with the design costs, a good designer includes it in the optimization process.

In conclusion we can state that: The designer always tries to find an optimal solution within the set of feasible solutions, called the design space. Before optimization techniques can be used, the design criteria must be quantified. This quantification can sometimes be difficult and good insight of the designer is a necessity. A good design means it has a thoughtful balance between optimization, robustness and human resources.

Below follows a list of some specific technical design criteria for ECS along with links to examples throughout the wikibook.
 * Reliability
 * Examples are:
 * Aviation - Flight control
 * Medical equipment
 * Typical measures include:
 * Redundancy
 * Safe failure modes: Failure modes and prevention
 * Embedded Systems/Watchdog Timers
 * Watchdogs
 * Communication: remote servicing, ...
 * Examples are:
 * Aviation - Air traffic control
 * Robotics - Robocup
 * Automotive - AutoSAR
 * A trend in embedded control systems is increasing communication. Between ECS but also with users. A good example of this trend is the AutoSAR project for standardization of the interface between the ECS in a car.
 * Remote servicing is also gaining in interest. The constant monitoring of the state of ECSs leads to extra knowledge of the machines. This knowledge can be used to improve the global process (i.e. in a oil refinery) and thus reduce cost.


text:
Embedded Control Systems Design/Categories of system complexity

This chapter will discuss issues around system complexity.

What is system complexity?

Before dealing with issues as categorising it is important to define the meaning of complexity. One could be tempted to say that the bigger the system, the more complex it is. Lets take a look at an example:

An electrician is about to wire two buildings. One is a small house, the other is an apartment building. Obviously, a lot more work will go into wiring the second and the fusebox of the latter will look more complex but the key idea is the same for both: Get the electricity to the light bulbs and plugs. The amount of plugs doesn’t matter. If you can do it for one, you can do it for a thousand. The scale is larger but the complexity is the same!

When looking at complexity this way it’s clear that complexity is not defined by scale (in this case: the amount of wires).

In this chapter complexity is defined by the number of asynchronous subsystems and the amount of their different communication and synchronization needs: every exchange of information between two activities that run in parallel disturbs in one way or another both running processes, and the handling of this disturbance in a predictable way is not at all obvious. (These aspects are explained in more detail in the chapter on asynchronous activities.) When looking at it this way, both the house and apartment building will classify as a non-complex system because there’s only one system and no need for communication.

How to classify complexity?

A possible classification, using the definition above, is given here.

 * Centralized hardware — Centralized Control (C1): in this kind of system all information is concentrated in one place. There’s no need for an operating system. These are systems that can be designed and developed by one or two engineers in a very small company, because the whole design and development can fit in one persons head.
 * Distributed Hardware — Centralized Control (C2): these systems consist of several smaller systems. Each subsystem has its own control unit. But every subsystem communicates with the main computer which takes all the decisions for the system. These systems require a team of, say, a dozen engineers in a large company. Specialization is most often inevitable.
 * Distributed Hardware — Distributed Control (C3): these systems also consist of several subsystems, but each system can take its own decisions, so there’s no need for a central main computer. These are the most complex systems-of-systems for which hundreds of developers have to work together, possibly in many different companies.

The goal of this classification is not to be exhaustive or complete, but to give technical project managers a first-order idea about complexity (and hence cost) of various embedded systems, and about the kind of technical and managerial challenges that can be expected for systems in each category.

Centralized Hardware — Centralized Control
Examples of this class are vending machines, elevator controllers, conveyor belts, traffic barriers, etc. A very important element in controlling these systems is a Programmable Logic Controller (PLC). It is the traditional device behind the interfacing and the control of simple systems.

This class of embedded system (or rather, embedded device) is characterized by the following:
 * it has one single processor, often of the embedded type.
 * all hardware peripherals are connected to the processor board via direct signal cables.
 * interfacing the hardware can be done via memory-mapped IO.
 * the software consists of one single thread, that executes the same program loop over and over again.
 * so, it needs no operating system.
 * the device is used for very well defined tasks in very well defined environments, that is, with little need for adaptation or variation.

Distributed Hardware — Centralized Control
A robot or machine tool controller is a typical representative of this class.

This class of embedded system is characterized by the following:
 * it has one single processor of the PC type, with possibly several embedded processors in some of the hardware peripherals.
 * some hardware peripherals are connected to the processor board via field busses.
 * interfacing of that type of hardware requires a software stack for the reception and sending of messages over the fieldbus, and for interpreting the content of the messages.
 * some of the peripheral hardware uses interrupts.
 * the software consists of multiple threads (sharing memory) or multiple processes (running in protected memory spaces), that each execute a program on their own, but that require synchronization and data exchange between each other.
 * so, an operating system is required.
 * the device has reprogrammability possibilities so that it can achieve various tasks in rather well defined environments.

Distributed Hardware — Distributed Control
A multi-agent system of robots, an air traffic control system, or an airport luggage handling system are typical representatives of this class.

This class of embedded system is characterized by the following:
 * the total system consists of a software and communication layer around a number of sub-systems, each of which belongs to one of the previous classes in itself.
 * each of the sub-systems often has multiple processors, of the embedded and of the PC type.
 * the sub-systems are communicating via various networking technologies, such as wired or wireless ethernet, radio communication, etc.
 * the communication is typically asynchronous.
 * the communication software requires extensive protocols that encode the knowledge to control the total system.
 * some of the peripheral hardware uses interrupts.
 * the software consists of multiple programs, of the service oriented architecture type.
 * multiple operating systems can be used in the various subsystems.
 * the overall system has extensive reprogrammability possibilities (up to replacing subsystems or their software on the fly) so that it can achieve various tasks in very different environments.

When designing this class of system there’s a strong need for model driven engineering. You need to be able to divide the system into subsystems and divide the functions because you’re working in different development teams. However at this point there are no adequate models available.

Dealing with complexity

When designing complex system several issues come up.

A key aspect of dealing with complexity is that the users of the system should not be confronted with the complexity of the system. This seems to be no problem as you could make the system function like a black box. Unfortunately, most systems need to be monitored. This proves to be a problem as the interface needs to be as simple as possible but still needs to give the right amount of information.

The accident at Three Mile Island illustrates the previous statement. One of the components of the Three Mile Island reactor stopped working, which lead to many other system components to shut down. Indicator lamps in the control room showed these problems and the operators were suddenly overwhelmed with information, much of it irrelevant or misleading. The operators incorrectly interpreted the indicators and were so confused that they made the wrong decisions, causing a partial core meltdown.

A possible way of dealing with this problem is monitoring functionality instead of components. Only when there’s something wrong with the functionality there’s a need of looking at the components.

The risk of failure increases with increasing complexity. More interaction leads to a greater risk of errors and a larger complexity complicates it for a user to see what’s wrong. There are three possible reactions to errors:

- Finding the error to prevent disaster

- Looking at what you should do first to repair the systems components

- Finding the design error that caused system failure

An example of complexity: The car

At first, a car was hardly more than an engine powered chariot. There were no asynchronous subsystems involved nor was there decision making by computers. It’s clear that, when using the previous explained concepts, this type of vehicle ranks as a non-complex system of type 1.

Over the years, the car has evolved a lot. Since the 80’s there’s a trend towards more computers in a car. There’s the ECU, the ABS and ESP units and even a computer regulating the air conditioning. These are all asynchronous subsystems making the car a system of type 3. (note that you can find arguments to declare the car a type 2 system.)

What hasn’t really changed over the years is the user interface. There still is a steering wheel, a gearshift nob and some gauges showing coolant temperature, fuel level and oil pressure. This illustrates nicely that it is possible not to show the user the full complexity of the vehicle.

There’s also a possible fourth category of centralised hardware and distributed control. A modern car is hard to characterise as any of the systems above, but it could be developing into this fourth system. A cars main computer needs to run several programs simultaneously. These programs don’t interact in any way.


text:
MediaWiki:Gadget-contribsrange.js

mw.loader.load('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-contribsrange.js&action=raw&ctype=text/javascript');

title: MediaWiki:Gadget-contribsrange.js


text:
MediaWiki:Gadget-contribsrange

Range contributions: Allow /16,/24-/32 CIDR ranges on Special:Contributions forms (uses API), as well as wildcard Prefix searches, eg: Splark*

title: MediaWiki:Gadget-contribsrange


text:
User talk:Arctic.gnome

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Arctic.gnome


text:
User talk:Maplestory~enwikibooks

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Maplestory. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Maplestory~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:24, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:14, 19 April 2015 (UTC)

title: User talk:Maplestory~enwikibooks


text:
User talk:Carmen Bluestarry9

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Carmen Bluestarry9


text:
User talk:Bluestarry9

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Bluestarry9


text:
User talk:Carmencool

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Carmencool


text:
User talk:Katterjohn~enwikibooks

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Katterjohn. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Katterjohn~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:22, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:07, 19 April 2015 (UTC)

title: User talk:Katterjohn~enwikibooks


text:
User talk:TheSwami

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:TheSwami


text:
User talk:Shirleyom

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Shirleyom


text:
User talk:Lingamcool

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Lingamcool


text:
User talk:Lingamcooll

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:40, 6 March 2008 (UTC)

title: User talk:Lingamcooll


text:
User talk:Aashwah2000~enwikibooks

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:41, 6 March 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Aashwah2000. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Aashwah2000~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 22:54, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:28, 19 April 2015 (UTC)

title: User talk:Aashwah2000~enwikibooks


text:
User talk:Ibrahim2000~enwikibooks

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 12:41, 6 March 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Ibrahim2000. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Ibrahim2000~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:14, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:02, 19 April 2015 (UTC)

title: User talk:Ibrahim2000~enwikibooks


text:
MediaWiki:Red-link-title

$1 (does not exist)

title: MediaWiki:Red-link-title


text:
User talk:ChrisDeemian

Welcome!
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.-- – Mike.lifeguard  | talk 13:04, 6 March 2008 (UTC)

title: User talk:ChrisDeemian


text:
User talk:Sarxan22

Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. -- Herby talk thyme 14:02, 6 March 2008 (UTC)

The page you created
"Khazar University Student Union" is not text book material and so is outside the scope of this project & has been deleted. Thanks -- Herby talk thyme 14:02, 6 March 2008 (UTC)

title: User talk:Sarxan22


text:
XForms/Dynamic Selection Lists

Motivation
You want that the content of a selection list to depend on the value another selection list. This is also known as "Cascading Selection".

Method
We have two instances in a model. The first instance populates the first select1 list. The second select1 uses an xf:itemset to only select the relevant items from the second instance. In effect we are adding a "where" clause to the list of items selected in the second list.

The presented form shows an example where the user can select a season (Spring, Summer,...) and in a second select the user will only be able to select from the relevant month in that season.

We also will automatically set the month to null when the season selection changes to make sure our pairing is always valid.

The example had been tested with Firefox 2.0.0.12 and the Mozilla XForms add on 0.8.4 as well as on FireFox 3.0.

Link to XForms Application
Load Example XForms Application

Note that the initial values of the selections are set in the instance values.

Sample Program

         <item name="September" season="Autumn"/> <item name="October" season="Autumn"/> <item name="November" season="Autumn"/> <item name="December" season="Winter"/> </xf:instance> <xf:bind id="selected-season" nodeset="instance('selected-values')/selected-season"/> </xf:model> Test conditional selection lists - month selector depends on the current season

<xf:select1 ref="instance('selected-values')/selected-season"> <xf:label>Season:</xf:label> <xf:itemset nodeset="instance('seasons')/item"> <xf:label ref="@name"/> <xf:value ref="@name"/> </xf:itemset> <xf:action ev:event="xforms-value-changed"> <xf:setvalue ref="instance('selected-values')/selected-month" value="''"/> </xf:action> </xf:select1> <xf:select1 ref="instance('selected-values')/selected-month"> <xf:label>Month:</xf:label> <xf:itemset nodeset="instance('months')/item[@season=instance('selected-values')/selected-season]"> <xf:label ref="@name"/> <xf:value ref="@name"/> </xf:itemset> </xf:select1> <xf:output ref="instance('selected-values')/selected-season"> <xf:label>selected-season: </xf:label> </xf:output>

<xf:output ref="instance('selected-values')/selected-month"> <xf:label>selected-month: </xf:label> </xf:output>

Relevant Months using Repeat <xf:repeat nodeset="instance('months')/item[@season=instance('selected-values')/selected-season]"> <xf:output ref="@name"/> </xf:repeat>

Updating the Second Select When the First Select Changes
Note that we have added an action and trap the xforms-value-changed event to the first select1 statement. We use the xf:setvalue event to change the value of the second select1 to be blank. This will guarantee that the pair of values will always be consistent.

This suggestion was made by Aaron Reed.

title: XForms/Dynamic Selection Lists


text: User talk:206.176.127.195

title: User talk:206.176.127.195


text:
XRX/Autoincrement File ID

Motivation
You want to create a new file and automatically create a new identifier for the file.

Method
Create an XML file with a single counter in it. Use this counter as part of the file name. After you confirm that the file has been saved, increment the counter using the update function.

Sample Code for save-new.xq
The following example works with an incoming HTTP POST request.

Taking into account concurrent access
Same as above but with locking the node holding the identifier.

The following example works with an incoming HTTP POST request.

Adding and Incrementing an Attribute
Note that the syntax for inserting an attribute is the following:

update insert attribute {$attrName} {$attrValue} into expression

The keyword attribute must be used and be followed with the attribute name and value.

If you want to store a new id in an attribute the syntax is:

update insert attribute {'id'} {$next-id} into $doc/root

Note: if the  already exists in the   then   works as

And if you are updating the id you can use the replace function with the @ in the path expression:

update replace doc/root/@id with ($next-id + 1)

Back: Regular Expression Builder • Next: Move a Resource

title: XRX/Autoincrement File ID


text: User talk:212.73.64.41

title: User talk:212.73.64.41


text:
User talk:HAckermann

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * Make sure to sign your posts and comments with four tildes, like this: ~~~~
 * There is a box at the top of the edit window (if javascript is enabled on your browser) that will insert it too (looks like part of a signature). This will let others know who left it, and make it easy to reply back to you.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * Wikibooks is a collection of open-source textbooks. (What is Wikibooks).
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Help us by participating in policy and guideline creation.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Reading Room, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add that page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic (talk) 15:36, 6 March 2008 (UTC)

title: User talk:HAckermann


text:
User talk:Thorbjørn Ravn Andersen

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * Make sure to sign your posts and comments with four tildes, like this: ~~~~
 * There is a box at the top of the edit window (if javascript is enabled on your browser) that will insert it too (looks like part of a signature). This will let others know who left it, and make it easy to reply back to you.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * Wikibooks is a collection of open-source textbooks. (What is Wikibooks).
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Help us by participating in policy and guideline creation.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Reading Room, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add that page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic (talk) 15:36, 6 March 2008 (UTC)

title: User talk:Thorbjørn Ravn Andersen


text:
User talk:Janell

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * Make sure to sign your posts and comments with four tildes, like this: ~~~~
 * There is a box at the top of the edit window (if javascript is enabled on your browser) that will insert it too (looks like part of a signature). This will let others know who left it, and make it easy to reply back to you.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * Wikibooks is a collection of open-source textbooks. (What is Wikibooks).
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Help us by participating in policy and guideline creation.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Reading Room, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add that page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic (talk) 15:36, 6 March 2008 (UTC)

title: User talk:Janell


text:
User talk:Jsigler

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * Remember to conduct any editing experiments in the sandbox.
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Reading Room, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add that page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic (talk) 15:36, 6 March 2008 (UTC)

Wikijunior:Famous Inventors
I understand this is a class project, and the students are fairly young. We still need you to be careful to make sure they don't simply copy text from other websites, as that would be a copyright violation. If you would like, we can import pages from Wikipedia (this complies with the GFDL), and your students can simply take sections of those pages, and merge it into the book. Since they are quite young, I think this would be the best idea. If you make up a list of articles from Wikipedia you'd like to copy from and add it to WB:RFI, we'll get them imported quickly for you. If you need help with anything else, don't hesitate to ask. I don't think we've ever had a class project working on a Wikijunior book, so this is pretty exciting! – Mike.lifeguard  | talk 13:57, 30 March 2008 (UTC)

 * So I've imported Galileo Galilei to Transwiki:Galileo Galilei. The process I'd suggest is that the page gets edited in the transwiki namespace, and then moved into the book. If the location in the book already exists, you'd need an admin to take care of that, but it shouldn't be a problem. Again, if you're going to take only a few sentences then attribution to Wikipedia in the edit summary should be fine. Hope this all helps. – Mike.lifeguard  | talk 21:28, 2 April 2008 (UTC)

Twinkle
Glad to see you using it, but please choose which revert option carefully. Vandal revert (in red) should be used for vandalism; AGF should be used to revert edits which were made with the right intentions, but should still be reverted. The middle one (blue) is what you want to use when reverting yourself. It lets you specify a revert reason (unless you disable that option). – Mike.lifeguard  | talk 00:57, 3 April 2008 (UTC)

title: User talk:Jsigler


text:
Fundamentals of Transportation/Traffic Flow

Traffic Flow is the study of the movement of individual drivers and vehicles between two points and the interactions they make with one another. Unfortunately, studying traffic flow is difficult because driver behavior cannot be predicted with one-hundred percent certainty. Fortunately, drivers tend to behave within a reasonably consistent range; thus, traffic streams tend to have some reasonable consistency and can be roughly represented mathematically. To better represent traffic flow, relationships have been established between the three main characteristics: (1) flow, (2) density, and (3) velocity. These relationships help in planning, design, and operations of roadway facilities.

Time-Space Diagram

Traffic engineers represent the location of a specific vehicle at a certain time with a time-space diagram. This two-dimensional diagram shows the trajectory of a vehicle through time as it moves from a specific origin to a specific destination. Multiple vehicles can be represented on a diagram and, thus, certain characteristics, such as flow at a certain site for a certain time, can be determined.

Flow and density
Flow (q) = the rate at which vehicles pass a fixed point (vehicles per hour), $$t_{measured}$$ = Average measured time headway

$$q = \frac{t_{measured}} \,\!$$

Density (Concentration) (k) = number of vehicles (N) over a stretch of roadway (L) (in units of vehicles per kilometer)

$$k = \frac{N}{L}\,\!$$

where:
 * $$N$$ = number of vehicles occupying a highway segment of length $$ L $$
 * $$q$$ = equivalent hourly flow
 * $$L$$ = length of roadway
 * $$k$$ = density

Speed
Measuring speed of traffic is not as obvious as it may seem; we can average the measurement of the speeds of individual vehicles over time or over space, and each produces slightly different results.

Time mean speed
Time mean speed ($$\overline {v_t } \,\!$$) = arithmetic mean of speeds of vehicles passing a point

$$\overline {v_t } = \frac{1}{N}\sum\limits_{n = 1}^N {v_n } \,\!$$

Space mean speed
Space mean speed ($$\overline {v_s } \,\!$$) is defined as the harmonic mean of speeds passing a point during a period of time. It also equals the average speeds over a length of roadway.

$$\overline {v_s } = \frac{N} \,\!$$

Relating time and space mean speed
Note that the time mean speed is average speed past a point as distinct from space mean speed which is average speed along a length.

The two speeds are related as

$$\overline {v_t } = \overline {v_s } + \frac{\sigma_s^2}{\overline {v_s }} \,\!$$

The time mean speed higher than the space mean speed, but the differences vary with the amount of variability within the speed of vehices. At high speeds (free flow), differences are minor, whereas in congested times, they might differ a factor 2.

Headway
The following definitions give what is referred to as the brutto gap (Asela) (Italian for gross), in contrast to netto gaps (Italian for net). Netto gaps give the distance or time between the rear bumper of a vehicle and the front bumper of the next.

Time headway
Time headway ($$h_t\,\!$$) = difference between the time when the front of a vehicle arrives at a point on the highway and the time the front of the next vehicle arrives at the same point (in seconds)

Average Time Headway ($$\overline {h_t } \,\!$$) = Average Travel Time per Unit Distance * Average Space Headway

$$\overline {h_t } = \overline t *\overline {h_s } \,\!$$

Space headway
Space headway ($$h_s$$) = difference in position between the front of a vehicle and the front of the next vehicle (in meters)

Average Space Headway ($$\overline {h_s } \,\!$$)= Space Mean Speed * Average Time Headway

$$\overline {h_s } = \overline {v_s } *\overline {h_t } \,\!$$

Note that density and space headway are related:

$$k = \frac{1} \,\!$$

Fundamental Diagram of Traffic Flow

The variables of flow, density, and space mean speed are related definitionally as:

$$q = k\overline {v_s } \,\!$$

Traditional Model (Parabolic)
Properties of the traditional fundamental diagram.

 * When density on the highway is zero, the flow is also zero because there are no vehicles on the highway
 * As density increases, flow increases
 * When the density reaches a maximum jam density ($$k_j$$), flow must be zero because vehicles will line up end to end
 * Flow will also increase to a maximum value ($$q_m$$), increases in density beyond that point result in reductions of flow.
 * Speed is space mean speed.
 * At density = 0, speed is freeflow ($$v_f$$). The upper half of the flow curve is uncongested, the lower half is congested.
 * The slope of the flow density curve gives speed. Rise/Run = Flow/Density = Vehicles per hour/ Vehicles per km = km / hour.

Observation (Triangular or Truncated Triangular)
Actual traffic data is often much noisier than idealized models suggest. However, what we tend to see is that as density rises, speed is unchanged to a point (capacity) and then begins to drop if it is affected by downstream traffic (queue spillbacks). For a single link, the relationship between flow and density is thus more triangular than parabolic. When we aggregate multiple links together (e.g. a network), we see a more parabolic shape.

Microscopic and Macroscopic Models
Models describing traffic flow can be classed into two categories: microscopic and macroscopic. Ideally, macroscopic models are aggregates of the behavior seen in microscopic models.

Microscopic Models
Microscopic models predict the following behavior of cars (their change in speed and position) as a function of the behavior of the leading vehicle.

Macroscopic Models
Macroscopic traffic flow theory relates traffic flow, running speed, and density. Analogizing traffic to a stream, it has principally been developed for limited access roadways (Leutzbach 1988). The fundamental relationship “q=kv” (flow (q) equals density (k) multiplied by speed (v)) is illustrated by the fundamental diagram. Many empirical studies have quantified the component bivariate relationships (q vs. v, q vs. k, k vs. v), refining parameter estimates and functional forms (Gerlough and Huber 1975, Pensaud and Hurdle 1991; Ross 1991; Hall, Hurdle and Banks 1992; Banks 1992; Gilchrist and Hall 1992; Disbro and Frame 1992).

The most widely used model is the Greenshields model, which posited that the relationships between speed and density is linear. These were most appropriate before the advent of high-powered computers enabled the use of microscopic models. Macroscopic properties like flow and density are the product of individual (microscopic) decisions. Yet those microscopic decision-makers are affected by the environment around them, i.e. the macroscopic properties of traffic.

While traffic flow theorists represent traffic as if it were a fluid, queueing analysis essentially treats traffic as a set of discrete particles. These two representations are not-necessarily inconsistent. The figures to the right show the same 4 phases in the fundamental diagram and the queueing input-output diagram. This is discussed in more detail in the next section.

Example 2: Computing Traffic Flow Characteristics
EXAMPLE 3: The spot speeds (expressed in km/hr) observed at a road section are 66, 62, 45, 79, 32, 51,56,60,53 and 49. The median speed (expressed in km/hr) is.

SOLUTION: Median speed is the speed at the middle value in series of spot speeds that are arranged in ascending order. 50% of speed values will be greater than the median 50% will be less than the median. Ascending order of spot speed studies are 32,39,45,51,53,56,60,62,66,79

Median speed = (53 +56 )/2=54.5 km/hr.

Thought Question
Problem

Microscopic traffic flow simulates the behaviors of individual vehicles while macroscopic traffic flow simulates the behaviors of the traffic stream overall. Conceptually, it would seem that microscopic traffic flow would be more accurate, as it would be based on driver behavior than simply flow characteristics. Assuming microscopic simulation could be calibrated to truly account for driver behaviors, what is the primary drawback to simulating a large network?

Solution

Computer power. To simulate a very large network with microscopic simulation, the number of vehicles that needed to be assessed is very large, requiring a lot of computer memory. Current computers have issues doing very large microscopic networks in a timely fashion, but perhaps future advances will do away with this issue.

Sample Problem

 * Problem (Solution)

Variables

 * $$ d_n $$= distance of nth vehicle
 * $$ t_n $$= travel time of nth vehicle
 * $$ v_n $$= speed (velocity) of nth vehicle
 * $$ h_{t,nm} $$= time headway between vehicles $$n$$ and $$m$$
 * $$ h_{s,nm} $$ = space (distance) headway between vehicles $$n$$ and $$m$$
 * $$ q $$ = flow past a fixed point (vehicles per hour)
 * $$ N $$ = number of vehicles
 * $$ t_{measured} $$ = time over which measurement takes place (number of seconds)
 * $$ t $$= travel time
 * $$ k $$= density (vehicles per km)
 * $$ L $$= length of roadway section (km)
 * $$ v_t $$= time mean speed
 * $$ v_s $$= space mean speed
 * $$ v_f $$= freeflow (uncongested speed)
 * $$ k_j $$= jam density
 * $$ q_m $$= maximum flow

Key Terms

 * Time-space diagram
 * Flow, speed, density
 * Headway (space and time)
 * Space mean speed, time mean speed
 * Microscopic, Macroscopic

Supplementary Reading

 * Revised Monograph on Traffic Flow Theory

Videos

 * Traffic Flow


text:
Fundamentals of Transportation/Traffic Flow/Problem

 * Solution

/Problems


text:
Fundamentals of Transportation/Traffic Flow/Solution

/Solutions


text: User talk:168.169.86.212

title: User talk:168.169.86.212


text:
Fundamentals of Transportation/Shockwaves

Shockwaves are byproducts of traffic congestion and queueing. They are transition zones between two traffic states that move through a traffic environment like, as their name states, a propagating wave. On the urban freeway, most drivers can identify them as a transition from a flowing, speedy state to a congested, standstill state. However, shockwaves are also present in the opposite case, where drivers who are idle in traffic suddenly are able to accelerate. Shockwaves are one of the major safety concerns for transportation agencies because the sudden change of conditions drivers experience as they pass through a shockwave often can cause accidents.

Visualization
While most people have probably experienced plenty of traffic congestion first hand, it is useful to see it systematically from three different perspectives: (1) That of the driver (with which most people are familiar), (2) a birdseye view, and (3) a helicopter view. Some excellent simulations are available here, please see the movies:

Visualization with the TU-Dresden 3D Traffic Simulator

This movie shows traffic jams without an "obvious source" such as an on-ramp, but instead due to randomness in driver behavior: Shockwave traffic jams recreated for first time

Analysis of shockwaves
Shockwaves can be seen by the cascading of brake lights upstream along a highway. They are often caused by a change in capacity on the roadways (a 4 lane road drops to 3), an incident, a traffic signal on an arterial, or a merge on freeway. As seen above, just heavy traffic flow alone (flow above capacity) can also induce shockwaves. In general, it must be remembered that capacity is a function of drivers rather than just being a property of the roadway and environment. As the capacity (maximum flow) drops from $$C_1$$ to $$C_2$$, optimum density also changes. Speeds of the vehicles passing the bottleneck will of course be reduced, but the drop in speed will cascade upstream as following vehicles also have to decelerate.

The figures illustrate the issues. On the main road, far upstream of the bottleneck, traffic moves at density $$k_1$$, below capacity ($$k_{opt}$$). At the bottleneck, density increases to accommodate most of the flow, but speed drops.

Shockwave speed
If the flow rates in the two sections are $$q_1$$ and $$q_2$$, then $$q_1=k_1 v_1$$ and $$q_2=k_2 v_2$$.

$$v_w = \frac \,\!$$

Relative speed
With $$v_1$$ equal to the space mean speed of vehicles in area 1, the speed relative to the line $$w$$ is:

$$v_{r1} = v_1  - v_w  \,\!$$

The speed of vehicles in area 2 relative to the line w is $$v_{r2} = v_2  - v_w  \,\!$$

Boundary crossing
The number of vehicles crossing line 2 from area 1 during time period $$t$$ is

$$N_1 = v_{r1} k_1 t = (v_1 - v_w) k_1 t\,\!$$

and similarly

$$N_2 = v_{r2} k_2 t = (v_2 - v_w) k_2 t\,\!$$

By conservation of flow, the number of vehicles crossing from left equals the number that crossed on the right

$$N_1=N_2	\,\!$$

so:

$$v_2 k_2 - v_1 k_1 = v_w (k_2 - k_1 )\,\!$$

or

$$q_2 - q_1 = v_w (k_2 - k_1 )\,\!$$

which is equivalent to

$$v_w = \frac \,\!$$

Example 1
 Problem: The traffic flow on a highway is $$q_1= 2000 veh/hr $$ with speed of $$v_1=80 km/hr $$. As the result of an accident, the road is blocked. The density in the queue is $$k_2 = 275 veh/km $$. (Jam density, vehicle length = 3.63 meters).

 * (A) What is the wave speed ($$v_w$$)?
 * (B) What is the rate at which the queue grows, in units of vehicles per hour ($$q$$)?

Thought Question
Problem

Shockwaves are generally something that transportation agencies would like to minimize on their respective corridor. Shockwaves are considered a safety concern, as the transition of conditions can often lead to accidents, sometimes serious ones. Generally, these transition zones are problems because of the inherent fallibility of human beings. That is, people are not always giving full attention to the road around them, as they get distracted by a colorful billboard, screaming kids in the backseat, or a flashy sports car in the adjacent lanes. If people were able to give full attention to the road, would these shockwaves still be causing accidents?

Solution

Yes, but not to the same extent. While accidents caused by driver inattentiveness would decrease nearly to zero, accidents would still be occurring between different vehicle types. For example, in a case where conditions change very dramatically, a small car (say, a Beetle) would be able to stop very quickly. A semi truck, however, is a much heavier vehicle and would require a longer distance to stop. If both were moving at the same speed when encountering the shockwave, the truck may not be able to stop in time before smashing into the vehicle ahead of them. That is why most trucks are seen creeping along through traffic with very big gaps ahead of them.

Sample Problem

 * Problem (Solution)

Additional Questions

 * Additional Questions
 * Homework

Variables

 * $$q$$ - flow
 * $$c$$ - capacity (maximum flow)
 * $$k$$ - density
 * $$v$$ - speed
 * $$v_r$$ - relative speed (travel speed minus wave speed)
 * $$v_w$$ - wave speed
 * $$N$$ - number of vehicles crossing wave boundary

Key Terms

 * Shockwaves
 * Time lag, space lag

Videos

 * Shockwaves
 * Shockwave Formation and Dissipation


text:
C++ Programming/Code/Standard C Library/Functions/atol

atol
The function atol converts str into a long, then returns that value. atol will read from str until it finds any character that should not be in a long. The resulting truncated value is then converted and returned. For example,

results in x being set to 1024L.

 * Related topics: atof - atoi - strtod (Standard C I/O) sprintf


text:
Cookbook talk:Double Chocolate Brownies

Cleanup
Hi, I cleaned the recipe up a tad based on my trial run. --Karl McClendon (talk) 18:15, 6 March 2008 (UTC)

Metric
have you got the metric values? as there are so many different types of 'cup'. It doesn't matter too much as it will be proportional, however, the quantity of egg may be wrong Sweetie candykim (discuss • contribs) 13:23, 29 July 2011 (UTC)

title: Cookbook talk:Double Chocolate Brownies


text:
XForms/Deep Copy with Insert Origin

Motivation
You want to add a new instance or element from a template. You want to do a deep copy of complex XML from one instance to another instance within a model.

Method
We will use the XForms xf:insert element with the origin attribute set to the source instance. We will use the nodeset attribute to indicate where the data should be copied to.

Link to XForms Application
Load XForms Application

Source Code

title: XForms/Deep Copy with Insert Origin


text:
Fundamentals of Transportation/Shockwaves/Problem

 * Solution

/Problems


text:
Fundamentals of Transportation/Shockwaves/Solution

/Solutions


text:
Talk:Communication Theory/Diffusion of Innovations

If you wish to include Gabriel Tarde as an initiator of the diffusion of innovation paradigm, then I guess it should be made clear that "innovation" is understood here in a very broad sense, and not only in terms of technology.

I am also surprised to see no reference to the Centre de sociologie de l'innovation of the École des mines (Michel Callon, Madeleine Akrich, Bruno Latour, and the whole "french connection").

I'll work on this when I have some time, if no one wants to take it over. --Niccoben (talk) 18:55, 6 March 2008 (UTC)


text:
User talk:Rbj

Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.

I heard from Jim that you are interested in working on the Digital Signal Processing and possibly the Signals and Systems books? I created both of those books back when I was still an undergrad, and haven't had the time to maintain them, much less improve them. I'm sure there are a lot of errors to be found, some that were typos on my part, or misunderstandings from back when I was less educated. These things are always a little funny in hindsight!

Anyway, you should find Wikibooks to be a very calm and productive working environment. We certainly don't subscribe to the same brand of aggressive nonsense that is common at Wikipedia. You are welcome to make any changes, large or small, to any books that you think need help. You don't need anybody's permission, although if you want a second opinion I'm always available to help. Also, if you have any questions, or if you need any help, don't hesitate to ask me or ask in one of our reading rooms. Welcome to Wikibooks. --Whiteknight (Page) (Talk) 19:41, 6 March 2008 (UTC)

title: User talk:Rbj


text:
Fundamentals of Transportation/Queueing

Queueing is the study of traffic behavior near a certain section where demand exceeds available capacity. Queues can be seen in many common situations: boarding a bus or train or plane, freeway bottlenecks, shopping checkout, exiting a doorway at the end of class, waiting for a computer in the lab, a hamburger at McDonald’s, or a haircut at the barber. In transportation engineering, queueing can occur at red lights, stop signs, bottlenecks, or any design-based or traffic-based flow constriction. When not dealt with properly, queues can result in severe network congestion or "gridlock" conditions, therefore making them something important to be studied and understood by engineers.

Cumulative Input-Output Diagram (Newell Curve)

Based on the departure rate and arrival rate pair data, the delay of every individual vehicle can be obtained. Using the input-output (I/O) queueing diagram shown in the side figure, it is possible to find the delay for every individual vehicle: the delay of the $$i^{th}$$ vehicle is time of departure - time of arrival ($$t_2-t_1$$). Total delay is the sum of the delays of each vehicle, which is the area in the triangle between the arrival (A(t)) and departure (D(t)) curves.

Distributions
Arrival Distribution - Deterministic (uniform) OR Random (e.g. Poisson)

Service Distribution - Deterministic OR Random

Service Method:
 * First Come First Served (FCFS) or First In First Out (FIFO)
 * Last Come First Served (LCFS) or Last In First Out (LIFO)
 * Priority (e.g. HOV bypasses at ramp meters)

Characterizing Queues
Queue Length Characteristics - Finite or Infinite

Number of Channels - Number of Waiting Lines (e.g. Ramps = 2, Supermarket = 12)

We use the following notation:
 * Arrival Rate = $$  \lambda $$
 * Departure Rate = $$ \mu $$

Utilization Rate $$ \rho  = \frac{\lambda }{\mu }\,\! $$

Degree of Saturation
Oversaturated: $$ \lambda > \mu $$

Undersaturated $$ \lambda < \mu $$

Saturated $$ \lambda = \mu $$

Little's Formula

Little's Formula: $$E(n)= \lambda E(v) $$

This means that the average queue size (measured in vehicles) equals the arrival rate (vehicles per unit time) multiplied by the average waiting time (both delay time in queue plus service time) (in units of time). This result is independent of particular arrival distributions and, while perhaps obvious, is an important fundamental principle that was not proven until 1961.

See Wikipedia article for more applications.

Uncapacitated Queues (M/D/1) and (M/M/1)
It has been shown that queue sizes, waiting times, and delays differ between M/D/1 and M/M/1 queueing. These differences are represented in formulas and shown below. Note the minor differences between the two.

Notes:
 * Average wait time (E(w)) excludes service time.
 * Average total delay (E(v)) is (wait time + service time). This is sometimes referred to average delay time due to the existence of the bottleneck.
 * Expected number of units in the system (E(n)) includes customers currently being served (in number of units). According to Little's Law this is arrival rate multiplied by the average time spent in the system $$E(n)=\lambda * E(v)$$.
 * Sometimes Expected number of units in the queue (E(m)) is requested, excluding customers being served, which is a different formula ( arrival rate multiplied by the average waiting time $$E(m)=\lambda * E(w)$$), and obviously results in a small number.

Uncapacitated queues (M/M/1) (random arrival and random service)
In addition to the properties stated before, M/M/1 queueing have a few additional ones of which to take note.

Capacitated Queues (Finite)
Capacitated queues permit a maximum number of vehicles to wait, and thus have different properties than uncapacitated queues. For single channel undersaturated finite queues where the maximum number of units in system is specified as $$N$$ and with random arrivals and departures ($$\lambda ,\mu$$) we have:

Real Life Causes of Queue Generation
For Roads:
 * Geometric Bottlenecks (lane drops, hard curves, hills)
 * Accidents and Incidents
 * Traffic Signals and Intersection Controls
 * At-Grade Crossings with other Modes (Railroad crossings, drawbridges, etc.)
 * Toll Booths
 * Ramp Meters
 * "Gawker" Effect
 * Inclement Weather

For Trains and Transit:
 * Platform Capacities
 * Fare Gates
 * Ticket Windows/Ticket Machines
 * Minimum Safe Separation for Trains
 * Security Checkpoints
 * Efficiency of Trains Entering and Leaving Station (number of tracks, switches, etc.)

For Aviation and Airports:
 * Runways
 * Designated Minimum Safe Following Distances for Planes (by government)
 * Physical Minimum Safe Following Distance for Planes (creation of turbulence, etc.)
 * Available Airspace for Approaches and Departures
 * Ticketing Counters/Check-in Procedures
 * Security Checkpoints
 * Baggage Systems
 * Terminal Capacity for Planes
 * Internal Terminal Capacity for Passengers
 * Inclement Weather

For Water and Maritime:
 * Locks and Dams
 * Port Capacities
 * Minimum "Safe" Distances (determined by government and physics)
 * Inclement Weather

For Space Flight:
 * Launch Capacity
 * Minimum Spacings between Orbital Vehicles
 * Inclement Weather on Earth
 * Unfavorable Celestial Conditions

Example 1
 Problem:

At the Krusty-Burger, if the arrival rate is 1 customer every minute and the service rate is 1 customer every 45 seconds, find the average queue size, the average waiting time, and average total delay. Assume an M/M/1 process.

 Solution:

To proceed, we convert everything to minutes.

Service time:

$$ = 0.75 minutes \,\!$$ per customer. Alternatively, you can say the server can handle 60/45 = 1/0.75 = 1.33 customers per minute.

The arrival rate is 1 customer per minute.

The utilization rate $$\rho = (60/60) / (60/45) = 0.75 $$ Meaning the server is busy on average 75% of the time.

Average queue size (E(n)):

$$ E(n) = \frac = \frac = 3 \,\!$$

$$E(n)= \lambda E(v) = 1 * 3.00 $$ Little's Formula

Average wait time:

$$ E(w) = \frac{\lambda } = \frac{1} = 2.25 \,\!$$

Average delay time:

$$ E(v) = \frac{1} = \frac{1} = 3 = E(w) + servicetime = 2.25 + 0.75 \,\!$$

Comparison:

We can compute the same results using the M/D/1 equations, the results are shown in the Table below.

As can be seen, the delay associated with the more random case (M/M/1, which has both random arrivals and random service) is greater than the less random case (M/D/1), which is to be expected.

Thought Question
Problem

How does one minimize wait time at a queue?

Solution

Cutting in line always helps, but this problem will be answered without breaking any rules. Think about going out to dinner, only to find a long line at your favorite restaurant. How do you deal with that? Maybe nothing can be done at that time, but the next time you go to that restaurant, you might pick a new time. Perhaps an earlier one to avoid the lunch or dinner rush. Similar decisions can be seen in traffic. People that are tired of being in network queues on their way to work may attempt to leave earlier or (if possible) later than rush hour to decrease their own travel time. This typically works well until all the other drivers figure out the same thing and shift congestion to a different time. To minimize wait time at a queue on the road, some places allow lane filtering and even lane splitting under certain circumstances. Some other places have considered these unsuccessfully.

""There is evidence (Hurt, 1981) that traveling between lanes of stopped or slow-moving cars (i.e., lane splitting) on multiple-lane roads (such as interstate highways) slightly reduces crash frequency compared with staying within the lane and moving with other traffic.""

Sample Problem 1 : Queueing at a Tollbooth
Problem (Solution)

Sample Problem 2 : Queueing at a Ramp Meter
Problem (Solution)

Sample Problem 3 : Queueing at a Ramp Meter
Problem (Solution)

Variables

 * A(t) = λ - Arrival Rate
 * D(t) = μ - Departure Rate
 * 1/μ - service time
 * ρ = λ/ μ - Utilization
 * Q - average queue size including customers currently being served (in number of units)
 * w - average wait time
 * t - average delay time (queue time + service time)

Key Terms

 * Queueing theory
 * Cumulative input-output diagram (Newell diagram)
 * average queue length
 * average waiting time
 * average total delay time in system
 * arrival rate, departure rate
 * undersaturated, oversaturated
 * D/D/1, M/D/1, M/M/1
 * Channels
 * Poisson distribution,
 * service rate
 * finite (capacitated) queues, infinite (uncapacitated) queues

External Exercises
The assignment seeks to provide students with the opportunity to gain a better understanding of two queuing theories: M/D/1 and M/M/1. Two preformatted spreadsheets have been made available for assistance in computing the values sought after in this exercise. While these spreadsheets provide the computations for these results, the formula is listed below for reference:

$$WT_q = (\frac)(\frac)\frac \,\!$$

Where:
 * $$WT_q\,\!$$: Average customer delay in the queue
 * $$C_\lambda\,\!$$: Coefficient of variation (CV) of the arrival distribution
 * $$C_\mu\,\!$$: Coefficient of variation of the departure distribution
 * $$CV\,\!$$: Standard deviation/mean; CV = (1/SqRt (mean)) for Poisson process and CV = 0 for constant distribution
 * $$\mu\,\!$$: Average departure rate
 * $$\lambda\,\!$$: Average arrival rate
 * $$\rho\,\!$$: Utilization = Arrival rate/service rate $$(\rho = \lambda / \mu)\,\!$$

M/D/1 Queueing

Download the file for M/D/1 Queueing from the University of Minnesota's STREET website: M/D/1 Queue Spreadsheet

With this spreadsheet, run 5 simulations for each of the 10 scenarios, using the arrival and departure information listed in the table below. In other words, program the same data into the spreadsheet 5 different times to capture a changing seed and, thus, produce slightly different answers because of the model's sensitivity. A total of 50 simulations will be run.

Also, find the utilization for all ten scenarios. Based on the utilization and the distribution variability, use the above equation to compute the average delays for all scenarios with utilization values of less than 1.

Finally, summarize the average-delays obtained both from the simulation and from the WTq equation in the same delay-utilization plot. Interpret your results. How does the average user delay change as utilization increases? Does the above equation provide a satisfactory approximation of the average delays?

M/M/1 Queueing

Download the file for M/M/1 Queueing from the University of Minnesota's STREET website: M/M/1 Queue Spreadsheet

With this spreadsheet, run 5 simulations for each of the 10 scenarios, using the arrival and departure information listed in the table below. In other words, program the same data into the spreadsheet 5 different times to capture a changing seed and, thus, produce slightly different answers because of the model's sensitivity. A total of 50 simulations will be run.

Again, you need to use five different random seeds for each scenario. Summarize the results in a delay-utilization plot. Interpret your results (You do NOT need to use the WTq equation given above to compute delays for the M/M/1 queue).

Additional Questions

 * Finally compare the M/M/1 queue and the M/D/1 queue. What conclusion can you draw? (For the same average arrival rate, do users experience the same delays in the two queuing systems? Why or why not?).
 * Provide a brief example where M/M/1 might be the appropriate model to use.
 * Provide a brief example where M/D/1 might be the appropriate model to use.

Additional Questions

 * Additional Questions
 * Homework

Videos

 * Introduction to Queueing
 * Deterministic Queues
 * The Rock Funnel Experiment
 * Stochastic Queues
 * Stochastic Queueing - Probabilistic Distributions
 * Queueing - Tollbooth Example

title: Fundamentals of Transportation/Queueing


text:
Cookbook:Bison Meatballs Baked in Hoisin Sauce (Marvin)

| United States | Meat | Bison

Marvins are a quick and tasty variation on the meatball.

Ingredients

 * 1 large red onion
 * 2 garlic cloves, minced
 * ¼ teaspoon cumin seeds
 * ¼ teaspoon coriander seeds
 * 3 peppercorns
 * 2 whole cloves
 * ¼ teaspoon sea salt
 * 1 lb (450 g) ground bison meat
 * ½ cup cooked rice
 * 10 large basil leaves, julienned
 * 1 teaspoon canola oil
 * ½ teaspoon fish sauce
 * Hoisin sauce

Procedure

 * 1) Preheat oven to 425°F (220°C).
 * 2) Oil the bottom of a 9x12-inch Pyrex baking dish.
 * 3) Thinly slice the onion to create long thin slices.
 * 4) Microwave the onion slices and garlic on high for 5 minutes.
 * 5) Grind the cumin, coriander, peppercorns, cloves, and salt together using a mortar and pestle.
 * 6) Roughly mix the softened onions and garlic, bison, rice, spice grind, fish sauce, and basil.
 * 7) Shape the meat mixture into tapered cylinders (similar to small sweet potatoes) and place into the baking dish. The Marvins should be about 1¼ inch diameter in the middle and 5 inches long.
 * 8) Coat the Marvins with hoisin sauce.
 * 9) Bake for 20–25 minutes in the preheated oven.

Notes, tips, and variations

 * Roll up in a warmed mooshi pancake with fresh cilantro or serve with a coconut milk-based curry sauce and rice.

Warnings

 * Always follow safe handling guidelines when using raw meat.


title: File:Wagon3.jpg


title: File:Wagon5.jpg


text:
Khepera III Toolbox/Examples/infrared proximity sensor response

This example shows how to experimentally measure the response of the infrared sensors in proximity mode. The robot starts right in front of an obstacle and then moves backwards in small steps. After each step, a series of infrared proximity measurements are taken.

Setup
Boot a Khepera III robot and make sure it is connected to your computer via WLAN. In the following explanation, we assume that you are working with robot 203. Put the robot in front of an obstacle and make sure that there is at least 50 cm space behind it.

Copy the motor_initialize, motor_stop and infrared_proximity programs onto the robot cd Programs k3put +203 motor_initialize motor_stop infrared_proximity Log on to the robot k3go +203 and type cd your_username ./motor_initialize to initialize the motors.

To check if everything is working, type ./infrared_proximity If your robot touches the obstacle in front of it, you should get results like this: The two highest values in the middle (3963 and 3965) belong to the front sensors and are those which we actually use in this experiment. These values may differ in your setup, since they are heavily influenced by the color and texture of your obstacle. Don't worry if you get values around 3000.

Running the Experiment
Position the robot right in front of your obstacle (such that it touches the obstacle) and launch ./run.pl The robot will now move backwards in small steps and take 10 infrared measurements which are stored in a file called run_results in the same folder. A complete run will take about 2 min, and the robot will stay at its place afterwards.

Parsing the Result File
Type the following line to process the result file ./parse_results.pl 5 < run_results > matlab_run_results_5 ./parse_results.pl 6 < run_results > matlab_run_results_6

Sensors 5 and 6 are the two front sensors. You could - in a similar fashion - take measurements with the other sensors as well.

Plotting the Result in Matlab
Launch Matlab and type plot_results The resulting diagram will show a curve for both sensors. Each point is an average of 10 samples.