text: User talk:212.2.2.107

title: User talk:212.2.2.107


text: User talk:209.226.83.2

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

title: User talk:209.226.83.2


text:
Video Game Design/Components

The creator(s)
Game creators are by definition artists since they produce creative works. To say games have no utilitarian use is a misconception of the art. Video games go above art and have a particularity: most components are modular by design or by characteristics. Games may have music, a story and visuals – each an artistic creation but which aggregate into a functional whole.

Most video games share characteristics with other video creations like cinema (film art), in a similar way as that relates to theater. The camera angles and story-telling concepts can literally be transposed to the video game medium with the added benefit of interactivity. In fact it is defended by many that these two mediums are converging into one. As an example we could point to how movie sound or 3D has evolved and even to tests of interactive movies or TV, where the audience selects the outcome of actions.

Often the video game "creator" label is not restricted only to the one that creates the game concept, but also to those that implement that vision. Most of the time there are technical constraints that must be dealt with or haphazard improvements that are made to the original creator's plan. Most video games today are collaborative works involving not only a large number of people but a large number of resources and technical know-how. There are people involved with composing music, working with sound, programming, testing, art, graphics, and much, much more.

Famous game creators:
 * Bullfrog Productions, the creators of many revolutionary games, for instance Populous or Syndicate.
 * Psygnosis (now SCE Studio Liverpool part of Sony Computer Entertainment Worldwide Studios), the creators of many innovative games like Shadow of the Beast, Lemmings and Wipeout.

The designer(s)
A video game is a collaboration of many different types of media and art, and more often than not requires as many skilled people to put it together as to make it commercially viable. There are of course games that do not pursue a profitable goal and then there are other mechanics outside of game creation to increase the popularity, visibility and profits around the game. For example, marketing has historically been able to eclipse the real quality of products which at times do not even merit the label on game. Then there is the gravitas of the intellectual property (IP) related to the game. For instance it is common for game studios to license other media's IP for their games. Often this reduces the necessity for creativity and the title will surf the popularity of the original product.

But before going on it is important to note that there is a difference between the people who are involved in creating a game: game creators and game designers. A game designer is the person who works with a game's core concepts, its level design, and various other aspects of the overall ideas of the game. Sometimes the functions are mixed and there are benefits to that but in the video game field the game designer can get reputation and recognition for the game, while the game creator will at best be recognized by the specific aspects of the game he directly worked on. More often creators get joint recognition as a software house for the work on a specific game.

Famous game designers (in no particular order) :
 * Shigeru Miyamoto, the designer, creator and producer of the Nintendo's Zelda and Mario franchises among other works.
 * Sid Meier, the designer, creator of several popular computer strategy games, most notably Civilization.
 * Peter Molyneux, created the god games Dungeon Keeper, Populous, and Black & White, among others, as well as business simulation games such as Theme Park and the RPG series Fable.
 * David Braben, creator Elite with Ian Bell, a hugely popular and influential space trading computer game, in the early 1980s. He was also the creator of Zarch (also known under its ported name of Virus).

The player(s)
The player is the person who plays a video game. They are the customer, and the focus of the video game industry.

62% of players are male, and the average age of the player is 31. These are important factors to consider for game designers when creating a game, because you create a game for these people, and it must be interesting and fun for them. They must also consider teenagers are a huge factor in the gaming industry, so add a bit of humor and a dash of attraction to keep them satisfied.

This does not mean you should ignore the other sector of players though. 31% of players are under the age of 18, and 25% of players are over the age of 50. This means that about $3,920,000,000 of that 7 Billion come from the players under 18 and over 50.

Interaction
While the computer is only capable of communicating to a limited number of senses (vision, audio and recently tactile) there are untapped methods of receiving communication from the player. This has shaped recent advances like scanning the player's body movement or even reading player's thoughts through brain–computer interface.

Here is how it works: the player observes the output of the video game and processes it in their mind. Then if any of what is processed is significant there may be an emotional response to this. If this happens then the player will become wholly involved in the video game experience – and it is then that a video game goes from pixels and sound waves to an epic experience.

Multi-player
Multi-player games is where players interact with one another through the video game's interface.

Network
A network is sort of both input and output – communication with other people and computers. Allows for a nearly limitless input ability.

Software/Hardware components
Software is what the game is. Hardware is what software, and so the game, runs on. As a simplification, hardware can be defined as anything you can physically touch that is part of your computer.

Some examples of hardware would be a sound card, or a graphics card.

Consoles vs. Computers
There is a big difference between a computer and a video game console.

A video game console is designed solely for its video games, and because of this it usually runs much smoother. The controls of consoles are often limited to what is needed to play the video games it offers. But the console has its limits, at the hardware level whatever is in the console, is in the console, and this means that the designers may or may not implement new or expand functions by customization and remote updates, the user has even less control, as consoles are often sold as black boxes without even offering public specs on the hardware they use beyond what is needed for marketing. In most cases, the graphical, auditory, and computational capabilities of a console are limited and fixed to what they had at the time of fabrication.

A computer on the other hand, has many things going on inside it – whether you like it or not. This can often (but not always) slow down and hinder game-play. But, in opposition to the video game console, the computer has almost unlimited possibilities for everything. The hardware can be exchanged for better hardware to make games run faster and smoother. However, unlike the console, the computer does not essentially use the dynamic control interface – often making game-play uncomfortable. This is only true for some games. In fact, some games are generally better suited to the use of the keyboard and mouse interface, such as Massively Multi-player and Real-time Strategy games.

Console vendors:
 * Nintendo
 * Play Station
 * Xbox
 * Sega

Portable devices
Portable devices can range from many varieties of consoles. The most popular portable device on the market is the Nintendo 3DS. But, with the new Nintendo Switch, things might change. Besides from Nintendo, Sony has made some portable gaming devices too. One of them is the PlayStation Vita. The Vita can play many games such as the ones on a PlayStation 3.

Input Devices (Controllers)
Input devices allow the player to interact with the game. In the ideal universe, the player could just think what they wanted to happen, but this – however – is not yet possible.

So, when designing a game you must consider very carefully the type of input you use. You must consider the limitations of the input device, how easy it is to use, and how the user will be using it. Listed in this section are the various types of input devices.

Every Controller is different, however most controllers have an analog stick, a d-pad, and some buttons. Often times, these controllers are designed to fit the needs of games. Being designed exclusively for games, they are usually much more effective than other input devices.

Keyboard and buttons
The keyboard is an interesting game input device, it has a vast selection of buttons, surpassing nearly all the other devices – granting a greater immersion through a larger choice of possible inputs sometimes at the cost of increased complexity. A disadvantage of the keyboard is that not present in all game devices by default (even unavailable at times), it is also too cumbersome for portable devices or limited in its implementation on/for them.

Joysticks
The Joystick started as an analog directional axis controller with a few buttons. Today it can also be a completely digital interface. It's gained popularity as a general propose controller for the first consoles or arcade machines. The joystick is not as sensitive as a mouse or a trackball but permits a greater freedom of use (space or surface) and on the personal computer it was made popular over the keyboard as a vehicle controller specially for airplane simulators. Today the joystick has lost some of its popularity and was replaced in most consoles by a default keypad and simulator-specific controller for driving cars, planes, or other things.

Mouse
Quickly able to move anywhere in the game environment, button action limited. The mouse grants the user a greater control over accuracy and precision than the typical joystick. However, generic mice have a very limited amount of input options, and therefore they normally require the complementary use of a keyboard.

More info

Other
There are many other types of input, such as touch screen, gyroscopic, motion sensing, and so forth.

Unusual devices may also be part of a merchandising scheme and even an attraction to sell games or game systems. From driving sets that attempt to emulate real car (or even airplane) controls to musical instruments (realistic or not), all type of objects can serve as input devices. We are also entering in a new stage beyond simple actuators to having the game system detect body movements and facial expressions, eliminating the need for any direct controller with the virtualization of it.

Output
Output, or the response to the input, is just as – if not more – important as the input portion of the gameplay experience. There are usually only 2 types of output any standard device can perform, visual output and auditory output.

Graphics
Graphics are the form of visual output seen on a computer monitor by use of little dots called pixels.

There are essentially two types of graphics: 2D and 3D, each offering very different gameplay experiences. However, 3D does not necessarily mean a better gameplay experience. Often, this is misconceived in today's game industry. A game developer will assume that because 3D is the most recent and advanced technology, it is naturally better.

While a 3D environment can provide a much deeper and more exciting gameplay experience, it is not always better. First off, we should make clear the difference between graphics and environment. The game environment is the realm the player is allowed and able to act within, while the graphics are what is seen.

Often times you will see a game with 3D graphics, but a 2D gameplay environment; Pac-Man World 3 is one of these. Oppositely, Super Mario Kart (for the Super Nintendo) would be considered a game with a 3D environment, but 2D graphics.

Another note, is that 3D graphics do not equal good graphics. There are plenty of games with 3D graphics that just look bad. And there are plenty of games with 2D graphics that look amazing. What makes graphics look good is very subjective; however, there are some concepts that seem to be good rules of thumb.

For any graphics to look good, they must be arranged in clearly defined objects (if there is a ball, you should be able to tell it is a ball). Lines should be straight, circles should be round, etc. For more realistic textures, modern games utilize bump mapping, which takes advantage of fractal geometry. A good example of this can be seen in the upcoming game Tekken 6.

There are also two types of graphic files: Raster and Vector.

As mentioned at the beginning of the chapter, a video game is, at its foundation, communication. Graphics allow the player to see the world within the screen. It is the job of the programmer to portray this world so that the player can become a part of it. More info: Senses

Audio
There are 2 basic kinds of audio used in games, Sound effects and Music – heard through the computer's Speakers.

Music can have a powerful effect on people, this effect is discussed later in the human element section of this chapter.

title: Video Game Design/Components


text:
Fundamentals of Transportation/Evaluation

A benefit-cost analysis (BCA) is often required in determining whether a project should be approved and is useful for comparing similar projects. It determines the stream of quantifiable economic benefits and costs that are associated with a project or policy. If the benefits exceed the costs, the project is worth doing; if the benefits fall short of the costs, the project is not. Benefit-cost analysis is appropriate where the technology is known and well understood or a minor change from existing technologies is being performed. BCA is not appropriate when the technology is new and untried because the effects of the technology cannot be easily measured or predicted. However, just because something is new in one place does not necessarily make it new, so benefit-cost analysis would be appropriate, e.g., for a light-rail or commuter rail line in a city without rail, or for any road project, but would not be appropriate (at the time of this writing) for something truly radical like teleportation.

The identification of the costs, and more particularly the benefits, is the chief component of the “art” of Benefit-Cost Analysis. This component of the analysis is different for every project. Furthermore, care should be taken to avoid double counting; especially counting cost savings in both the cost and the benefit columns. However, a number of benefits and costs should be included at a minimum. In transportation these costs should be separated for users, transportation agencies, and the public at large. Consumer benefits are measured by consumer’s surplus. It is important to recognize that the demand curve is downward sloping, so there a project may produce benefits both to existing users in terms of a reduction in cost and to new users by making travel worthwhile where previously it was too expensive.

Agency benefits come from profits. But since most agencies are non-profit, they receive no direct profits. Agency construction, operating, maintenance, or demolition costs may be reduced (or increased) by a new project; these cost savings (or increases) can either be considered in the cost column, or the benefit column, but not both.

Society is impacted by transportation project by an increase or reduction of negative and positive externalities. Negative externalities, or social costs, include air and noise pollution and accidents. Accidents can be considered either a social cost or a private cost, or divided into two parts, but cannot be considered in total in both columns.

If there are network externalities (i.e. the benefits to consumers are themselves a function of the level of demand), then consumers’ surplus for each different demand level should be computed. Of course this is easier said than done. In practice, positive network externalities are ignored in Benefit Cost Analysis.

Early Beginnings
When Benjamin Franklin was confronted with difficult decisions, he often recorded the pros and cons on two separate columns and attempted to assign weights to them. While not mathematically precise, this “moral or prudential algebra”, as he put it, allowed for careful consideration of each “cost” and “benefit” as well as the determination of a course of action that provided the greatest benefit. While Franklin was certainly a proponent of this technique, he was certainly not the first. Western European governments, in particular, had been employing similar methods for the construction of waterway and shipyard improvements.

Ekelund and Hebert (1999) credit the French as pioneers in the development of benefit-cost analyses for government projects. The first formal benefit-cost analysis in France occurred in 1708. Abbe de Saint-Pierre attempted to measure and compare the incremental benefit of road improvements (utility gained through reduced transport costs and increased trade), with the additional construction and maintenance costs. Over the next century, French economists and engineers applied their analysis efforts to canals (Ekelund and Hebert, 1999). During this time, The École Polytechnique had established itself as France’s premier educational institution, and in 1837 sought to create a new course in “social arithmetic”: “…the execution of public works will in many cases tend to be handled by a system of concessions and private enterprise. Therefore our engineers must henceforth be able to evaluate the utility or inconvenience, whether local or general, or each enterprise; consequently they must have true and precise knowledge of the elements of such investments.” (Ekelund and Hebert, 1999, p. 47). The school also wanted to ensure their students were aware of the effects of currencies, loans, insurance, amortization and how they affected the probable benefits and costs to enterprises.

In the 1840s French engineer and economist Jules Dupuit (1844, tr. 1952) published an article “On Measurement of the Utility of Public Works”, where he posited that benefits to society from public projects were not the revenues taken in by the government (Aruna, 1980). Rather the benefits were the difference between the public’s willingness to pay and the actual payments the public made (which he theorized would be smaller). This “relative utility” concept was what Alfred Marshall would later rename with the more familiar term, “consumer surplus” (Ekelund and Hebert, 1999).

Vilfredo Pareto (1906) developed what became known as Pareto improvement and Pareto efficiency (optimal) criteria. Simply put, a policy is a Pareto improvement if it provides a benefit to at least one person without making anyone else worse off (Boardman, 1996). A policy is Pareto efficient (optimal) if no one else can be made better off without making someone else worse off. British economists Kaldor and Hicks (Hicks, 1941; Kaldor, 1939) expanded on this idea, stating that a project should proceed if the losers could be compensated in some way. It is important to note that the Kaldor-Hicks criteria states it is sufficient if the winners could potentially compensate the project losers. It does not require that they be compensated.

Benefit-cost Analysis in the United States
Much of the early development of benefit-cost analysis in the United States is rooted in water related infrastructure projects. The US Flood Control Act of 1936 was the first instance of a systematic effort to incorporate benefit-cost analysis to public decision-making. The act stated that the federal government should engage in flood control activities if “the benefits to whomsoever they may accrue [be] in excess of the estimated costs,” but did not provide guidance on how to define benefits and costs (Aruna, 1980, Persky, 2001). Early Tennessee Valley Authority (TVA) projects also employed basic forms of benefit-cost analysis (US Army Corp of Engineers, 1999). Due to the lack of clarity in measuring benefits and costs, many of the various public agencies developed a wide variety of criteria. Not long after, attempts were made to set uniform standards.

The U.S. Army Corp of Engineers “Green Book” was created in 1950 to align practice with theory. Government economists used the Kaldor-Hicks criteria as their theoretical foundation for the restructuring of economic analysis. This report was amended and expanded in 1958 under the title of “The Proposed Practices for Economic Analysis of River Basin Projects” (Persky, 2001).

The Bureau of the Budget adopted similar criteria with 1952’s Circular A-47 - “Reports and Budget Estimates Relating to Federal Programs and Projects for Conservation, Development, or Use of Water and Related Land Resources”.

Modern Benefit-cost Analysis
During the 1960s and 1970s the more modern forms of benefit-cost analysis were developed. Most analyses required evaluation of:

 * 1) 	The present value of the benefits and costs of the proposed project at the time they occurred
 * 2) 	The present value of the benefits and costs of alternatives occurring at various points in time (opportunity costs)
 * 3) 	Determination of risky outcomes (sensitivity analysis)
 * 4) 	The value of benefits and costs to people with different incomes (distribution effects/equity issues) (Layard and Glaister, 1994)

The Planning Programming Budgeting System (PPBS) - 1965
The Planning Programming Budgeting System (PPBS) developed by the Johnson administration in 1965 was created as a means of identifying and sorting priorities. This grew out of a system Robert McNamara created for the Department of Defense a few years earlier (Gramlich, 1981). The PPBS featured five main elements:

 * 1) 	A careful specification of basic program objectives in each major area of governmental activity.
 * 2) 	An attempt to analyze the outputs of each governmental program.
 * 3) 	An attempt to measure the costs of the program, not for one year but over the next several years (“several” was not explicitly defined).
 * 4) 	An attempt to compare alternative activities.
 * 5) 	An attempt to establish common analytic techniques throughout the government.

Office of Management and Budget (OMB) – 1977
Throughout the next few decades, the federal government continued to demand improved benefit-cost analysis with the aim of encouraging transparency and accountability. Approximately 12 years after the adoption of the PPBS system, the Bureau of the Budget was renamed the Office of Management and Budget (OMB). The OMB formally adopted a system that attempts to incorporate benefit-cost logic into budgetary decisions. This came from the Zero-Based Budgeting system set up by Jimmy Carter when he was governor of Georgia (Gramlich, 1981).

Recent Developments
Executive Order 12292, issued by President Reagan in 1981, required a regulatory impact analysis (RIA) for every major governmental regulatory initiative over $100 million. The RIA is basically a benefit-cost analysis that identifies how various groups are affected by the policy and attempts to address issues of equity (Boardman, 1996).

According to Robert Dorfman, (Dorfman, 1997) most modern-day benefit-cost analyses suffer from several deficiencies. The first is their attempt “to measure the social value of all the consequences of a governmental policy or undertaking by a sum of dollars and cents”. Specifically, Dorfman mentions the inherent difficultly in assigning monetary values to human life, the worth of endangered species, clean air, and noise pollution. The second shortcoming is that many benefit-cost analyses exclude information most useful to decision makers: the distribution of benefits and costs among various segments of the population. Government officials need this sort of information and are often forced to rely on other sources that provide it, namely, self-seeking interest groups. Finally, benefit-cost reports are often written as though the estimates are precise, and the readers are not informed of the range and/or likelihood of error present.

The Clinton Administration sought proposals to address this problem in revising Federal benefit-cost analyses. The proposal required numerical estimates of benefits and costs to be made in the most appropriate unit of measurement, and “specify the ranges of predictions and shall explain the margins of error involved in the quantification methods and in the estimates used” (Dorfman, 1997). Executive Order 12898 formally established the concept of Environmental Justice with regards to the development of new laws and policies, stating they must consider the “fair treatment for people of all races, cultures, and incomes.” The order requires each federal agency to identify and address “disproportionately high and adverse human health or environmental effects of its programs, policies and activities on minority and low-income populations.”

Probabilistic Benefit-Cost Analysis

In recent years there has been a push for the integration of sensitivity analyses of possible outcomes of public investment projects with open discussions of the merits of assumptions used. This “risk analysis” process has been suggested by Flyvbjerg (2003) in the spirit of encouraging more transparency and public involvement in decision-making.

The Treasury Board of Canada’s Benefit-Cost Analysis Guide recognizes that implementation of a project has a probable range of benefits and costs. It posits that the “effective sensitivity” of an outcome to a particular variable is determined by four factors:

 * the responsiveness of the Net Present Value (NPV) to changes in the variable;
 * the magnitude of the variable's range of plausible values;
 * the volatility of the value of the variable (that is, the probability that the value of the variable will move within that range of plausible values); and
 * the degree to which the range or volatility of the values of the variable can be controlled.

It is helpful to think of the range of probable outcomes in a graphical sense, as depicted in Figure 1 (probability versus NPV).

Once these probability curves are generated, a comparison of different alternatives can also be performed by plotting each one on the same set of ordinates. Consider for example, a comparison between alternative A and B (Figure 2).

In Figure 2, the probability that any specified positive outcome will be exceeded is always higher for project B than it is for project A. The decision maker should, therefore, always prefer project B over project A.  In other cases, an alternative may have a much broader or narrower range of NPVs compared to other alternatives (Figure 3).

Some decision-makers might be attracted by the possibility of a higher return (despite the possibility of greater loss) and therefore might choose project B. Risk-averse decision-makers will be attracted by the possibility of lower loss and will therefore be inclined to choose project A.

Discount rate
Both the costs and benefits flowing from an investment are spread over time. While some costs are one-time and borne up front, other benefits or operating costs may be paid at some point in the future, and still others received as a stream of payments collected over a long period of time. Because of inflation, risk, and uncertainty, a dollar received now is worth more than a dollar received at some time in the future. Similarly, a dollar spent today is more onerous than a dollar spent tomorrow. This reflects the concept of time preference that we observe when people pay bills later rather than sooner. The existence of real interest rates reflects this time preference. The appropriate discount rate depends on what other opportunities are available for the capital. If simply putting the money in a government insured bank account earned 10% per year, then at a minimum, no investment earning less than 10% would be worthwhile. In general, projects are undertaken with those with the highest rate of return first, and then so on until the cost of raising capital exceeds the benefit from using that capital. Applying this efficiency argument, no project should be undertaken on cost-benefit grounds if another feasible project is sitting there with a higher rate of return.

Three alternative bases for the setting the government’s test discount rate have been proposed:
 * 1) 	The social rate of time preference recognizes that a dollar's consumption today will be more valued than a dollar's consumption at some future time for, in the latter case, the dollar will be subtracted from a higher income level. The amount of this difference per dollar over a year gives the annual rate.  By this method, a project should not be undertaken unless its rate of return exceeds the social rate of time preference.
 * 2) 	The opportunity cost of capital basis uses the rate of return of private sector investment, a government project should not be undertaken if it earns less than a private sector investment. This is generally higher than social time preference.
 * 3) 	The cost of funds basis uses the cost of government borrowing, which for various reasons related to government insurance and its ability to print money to back bonds, may not equal exactly the opportunity cost of capital.

Typical estimates of social time preference rates are around 2 to 4 percent while estimates of the social opportunity costs are around 7 to 10 percent.

Generally, for Benefit-Cost studies an acceptable rate of return (the government’s test rate) will already have been established. An alternative is to compute the analysis over a range of interest rates, to see to what extent the analysis is sensitive to variations in this factor. In the absence of knowing what this rate is, we can compute the rate of return (internal rate of return) for which the project breaks even, where the net present value is zero. Projects with high internal rates of return are preferred to those with low rates.

Determine a present value
The basic math underlying the idea of determining a present value is explained using a simple compound interest rate problem as the starting point. Suppose the sum of $100 is invested at 7 percent for 2 years. At the end of the first year the initial $100 will have earned $7 interest and the augmented sum ($107) will earn a further 7 percent (or $7.49) in the second year. Thus at the end of 2 years the $100 invested now will be worth $114.49.

The discounting problem is simply the converse of this compound interest problem. Thus, $114.49 receivable in 2 years time, and discounted by 7 per cent, has a present value of $100.

Present values can be calculated by the following equation:

(1) $$ P = \frac{F} \,\!$$ where:
 * F = future money sum
 * P = present value
 * i = discount rate per time period (i.e. years) in decimal form (e.g. 0.07)
 * n = number of time periods before the sum is received (or cost paid, e.g. 2 years)

Illustrating our example with equations we have: $$ P = \frac{F} = \frac = 100.00 \,\!$$

The present value, in year 0, of a stream of equal annual payments of A starting year 1, is given by the reciprocal of the equivalent annual cost. That is, by:

(2) $$ P = A\left[ {\frac} \right] \,\!$$

where:
 * A = Annual Payment

For example: 12 annual payments of $500, starting in year 1, have a present value at the middle of year 0 when discounted at 7% of: $3971 $$ P = A\left[ {\frac} \right] = 500\left[ {\frac} \right] = 3971 \,\!$$

The present value, in year 0, of m annual payments of A, starting in year n + 1, can be calculated by combining discount factors for a payment in year n and the factor for the present value of m annual payments. For example: 12 annual mid-year payments of $250 in years 5 to 16 have a present value in year 4 of $1986 when discounted at 7%. Therefore in year 0, 4 years earlier, they have a present value of $1515.

$$ P_{Y = 4} = A\left[ {\frac} \right] = 250\left[ {\frac} \right] = 1986 \,\!$$

$$ P_{Y = 0} = \frac{F} = \frac = \frac = 1515 \,\!$$

Evaluation criterion
Three equivalent conditions can tell us if a project is worthwhile
 * 1) 	The discounted present value of the benefits exceeds the discounted present value of the costs
 * 2) 	The present value of the net benefit must be positive.
 * 3) 	The ratio of the present value of the benefits to the present value of the costs must be greater than one.

However, that is not the entire story. More than one project may have a positive net benefit. From the set of mutually exclusive projects, the one selected should have the highest net present value. We might note that if there are insufficient funds to carry out all mutually exclusive projects with a positive net present value, then the discount used in computing present values does not reflect the true cost of capital. Rather it is too low.

There are problems with using the internal rate of return or the benefit/cost ratio methods for project selection, though they provide useful information. The ratio of benefits to costs depends on how particular items (for instance, cost savings) are ascribed to either the benefit or cost column. While this does not affect net present value, it will change the ratio of benefits to costs (though it cannot move a project from a ratio of greater than one to less than one).

Example 1: Benefit Cost Application
 Problem:

This problem, adapted from Watkins (1996), illustrates how a Benefit Cost Analysis might be applied to a project such as a highway widening. The improvement of the highway saves travel time and increases safety (by bringing the road to modern standards). But there will almost certainly be more total traffic than was carried by the old highway. This example excludes external costs and benefits, though their addition is a straightforward extension. The data for the “No Expansion” can be collected from off-the-shelf sources. However the “Expansion” column’s data requires the use of forecasting and modeling. Assume there are 250 weekdays (excluding holidays) each year and four rush hours per weekday.

Note: the operating cost for a vehicle is unaffected by the project, and is $4.

What is the benefit-cost relationship?

 Solution:

Benefits

A 50 minute trip at $0.15/minute is $7.50, while a 30 minute trip is only $4.50. So for existing users, the expansion saves $3.00/trip. Similarly in the off-peak, the cost of the trip drops from $3.50 to $2.50, saving $1.00/trip.

Consumers’ surplus increases both for the trips which would have been taken without the project and for the trips which are stimulated by the project (so-called “induced demand”), as illustrated above in Figure 1. Our analysis is divided into Old and New Trips, the benefits are given in Table 3.

Note: Old Trips: For trips which would have been taken anyway the benefit of the project equals the value of the time saved multiplied by the number of trips. New Trips: The project lowers the cost of a trip and public responds by increasing the number of trips taken. The benefit to new trips is equal to one half of the value of the time saved multiplied by the increase in the number of trips. There are 1000 peak hours per year. With 8760 hours per year, we get 7760 offpeak hours per year. These numbers permit the calculation of annual benefits (shown in Table 4).

The safety benefits of the project are the product of the number of lives saved multiplied by the value of life. Typical values of life are on the order of $3,000,000 in US transportation analyses. We need to value life to determine how to trade off between safety investments and other investments. While your life is invaluable to you (that is, I could not pay you enough to allow me to kill you), you don’t act that way when considering chance of death rather than certainty. You take risks that have small probabilities of very bad consequences. You do not invest all of your resources in reducing risk, and neither does society. If the project is expected to save one life per year, it has a safety benefit of $3,000,000. In a more complete analysis, we would need to include safety benefits from non-fatal accidents.

The annual benefits of the project are given in Table 5. We assume that this level of benefits continues at a constant rate over the life of the project.

Costs

Highway costs consist of right-of-way, construction, and maintenance. Right-of-way includes the cost of the land and buildings that must be acquired prior to construction. It does not consider the opportunity cost of the right-of-way serving a different purpose. Let the cost of right-of-way be $100 million, which must be paid before construction starts. In principle, part of the right-of-way cost can be recouped if the highway is not rebuilt in place (for instance, a new parallel route is constructed and the old highway can be sold for development). Assume that all of the right-of-way cost is recoverable at the end of the thirty-year lifetime of the project. The $1 billion construction cost is spread uniformly over the first four-years. Maintenance costs $2 million per year once the highway is completed.

The schedule of benefits and costs for the project is given in Table 6.

Conversion to Present Value

The benefits and costs are in constant value dollars. Assume the real interest rate (excluding inflation) is 2%. The following equations provide the present value of the streams of benefits and costs.

To compute the Present Value of Benefits in Year 5, we apply equation (2) from above.

$$ P = A\left[ {\frac} \right] = 139.72\left[ {\frac} \right] = 2811.31 \,\!$$

To convert that Year 5 value to a Year 1 value, we apply equation (1)

$$ P = \frac{F} = \frac = 2597.21 \,\!$$

The present value of right-of-way costs is computed as today’s right of way cost ($100 M) minus the present value of the recovery of those costs in Year 30, computed with equation (1):

$$ P = \frac{F} = \frac = 55.21 \,\!$$

$$ 100 - 55.21 = 44.79 \,\!$$

The present value of the construction costs is computed as the stream of $250M outlays over four years is computed with equation (2):

$$ P = A\left[ {\frac} \right] = 250\left[ {\frac} \right] = 951.93 \,\!$$ Maintenance Costs are similar to benefits, in that they fall in the same time periods. They are computed the same way, as follows: To compute the Present Value of $2M in Maintenance Costs in Year 5, we apply equation (2) from above.

$$ P = A\left[ {\frac} \right] = 2\left[ {\frac} \right] = 40.24 \,\!$$

To convert that Year 5 value to a Year 1 value, we apply equation (1)

$$ P = \frac{F} = \frac = 37.18 \,\!$$

As Table 7 shows, the benefit/cost ratio of 2.5 and the positive net present value of $1563.31 million indicate that the project is worthwhile under these assumptions (value of time, value of life, discount rate, life of the road). Under a different set of assumptions, (e.g. a higher discount rate), the outcome may differ.

Thought Questions

Decision Criteria
Which is a more appropriate decision criteria: Benefit/Cost or Benefit - Cost? Why?

Is it only money that matters?
Problem

Is money the only thing that matters in Benefit-Cost Analysis? Is "converted" money the only thing that matters? For example, the value of human life in dollars?

Solution

Absolutely not. A lot of benefits and costs can be converted to monetary value, but not all. For example, you can put a price on human safety, but how can you put a price on, say, aesthetics—something that everyone agrees is beneficial. What else can you think of?

Can small units of time be given the same value of time as larger units of time?
In other words, do 60 improvements each saving a traveler 1 minute equal 1 improvement saving a traveler 60 minutes? Similarly, does 1 improvement saving a 1000 travelers 1 minute equal the value of time of a single traveler of 1000 minutes. These are different problems, one is intra-traveler and one is inter-traveler, but related.

Several issues arise.

A. Is value of time linear or non-linear? To this we must conclude the value of time is surely non-linear. I am much more agitated waiting 3 minutes at a red light than 2, and I begin to suspect the light is broken. Studies of ramp meters show a similar phenomena.

B. How do we apply this in a benefit-cost analysis? If we break one project into 60 smaller projects, each with a smaller value of travel time saved, and then we added the gains, we would get a different result than the what obtains with a single large project. For analytical convenience, we would like our analyses to be additive, not sub-additive, otherwise arbitrarily dividing the project changes the result. In particular many smaller projects will produce an undercount that is quite significant, and result in a much lower benefit than if the projects were bundled.

As a practical matter, every Benefit/Cost Analysis assumes a single value of time, rather than assuming non-linear value of time. This also helps avoiding biasing public investments towards areas with people who have a high value of time (the rich)

On the other hand, mode choice analyses do however weight different components of travel time differently, especially transit time (i.e. in-vehicle time is less onerous than waiting time). The implicit value of time for travelers does depend on the type of time (though generally not the amount of time). Using the log-sum of the mode choice model as a measure of benefit would implicitly account for this.

Are sunk costs sunk, is salvage value salvageable? A paradox in engineering economics analysis
Salvage value is defined as "The estimated value of an asset at the end of its useful life." Sunk cost is defined as "Cost already incurred which cannot be recovered regardless of future events."

It is often said in economics that "sunk costs are sunk", meaning they should not be considered a cost in economic analysis, because the money has already been spent.

Now consider two cases

In case 1, we have a road project that costs $10.00 today, and at the end of 10 years has some economic value remaining, let's say a salvage value of $5.00, which when discounted back to the present is $1.93 (at 10% interest). This value is the residual value of the road. Thus, the total present cost of the project $10.00 - $1.93 = $8.07. Clearly the road cannot be moved. However, its presence makes it easier to build future roads ... the land has been acquired and graded, some useful material for aggregate is on-site perhaps, and can be thought of as the amount that it reduces the cost of future generations to build the road. Alternatively, the land could be sold for development if the road is no longer needed, or turned into a park.

Assume the present value of the benefit of the road is $10.00. The benefit/cost ratio is $10.00 over $8.07 or 1.23. If we treat the salvage value as a benefit rather than cost, the benefit is $10.00 + $1.93 = $11.93 and the cost is $10, and the B/C is 1.193.

In 10 years time, the community decides to replace the old worn out road with a new road. This is a new project. The salvage value from the previous project is now the sunk cost of the current project (after all the road is there and could not be moved, and so does not cost the current project anything to exploit). So the cost of the project in 10 years time would be $10.00 - $5.00 = $5.00. Discounting that to the present is $1.93.

The benefit in 10 years time is also $10.00, but the cost in 10 years time was $5.00, and the benefit/cost ratio they perceive is $10.00/$5.00 = 2.00

Aggregating the two projects
 * the benefits are $10 + $3.86 = $13.86
 * the costs are $8.07 + $1.93 = $10.00
 * the collective benefit/cost ratio is 1.386
 * the NPV is benefits - costs = $3.86

One might argue the salvage value is a benefit, rather than a cost reduction. In that case
 * the benefits are $10.00 + $1.93 + $3.86 = $15.79
 * the costs are $10.00 + $1.93 = $11.93
 * the collective benefit/cost ratio is 1.32
 * the NPV remains $3.86

Case 2 is an identical road, but now the community has a 20 year time horizon to start. The initial cost is $10, and the cost in 10 years time is $5.00 (discounted to $1.93). The benefits are $10 now and $10 in 10 years time (discounted to $3.86). There is no salvage value at the end of the first period, nor sunk costs at the beginning of the second period. What is the benefit cost ratio?
 * the costs are $11.93
 * the benefits are still $13.86
 * the benefit/cost ratio is 1.16
 * the NPV is $1.93.

If you are the community, which will you invest in? Case 1 has an initial B/C of 1.23 (or 1.193), Case 2 has a B/C of 1.16. But the real benefits and real costs of the roads are identical.

The salvage value in this example is, like so much in economics (think Pareto optimality), an accounting fiction. In this case no transaction takes place to realize that salvage value. On the other hand, excluding the salvage value over-estimates the net cost of the project, as it ignores potential future uses of the project.

Time horizons on projects must be comparable to correctly assess relative B/C ratio, yet not all projects do have the same benefit/cost ratio.

Software Tools for Impact Analysis
The majority of economic impact studies for highway capacity projects are undertaken using conventional methods. These methods tend to focus on the direct user impacts of individual projects in terms of travel costs and outcomes, and compare sums of quantifiable, discounted benefits and costs. Inputs to benefit-cost analyses can typically be obtained from readily available data sources or model outputs (such as construction and maintenance costs, and before and after estimates of travel demand, by vehicle class, along with associated travel times). Valuation of changes in external, somewhat intangible costs of travel (e.g., air pollution and crash injury) can usually be accommodated by using shadow price estimates, such as obtained from FHWA-suggested values, based on recent empirical studies.

The primary benefits included in such studies are those related to reductions in user cost, such as travel time savings and vehicle operating costs (e.g. fuel costs, vehicle depreciation, etc.). Additional benefits may stem from reductions in crash rates, vehicle emissions, noise, and other costs associated with vehicle travel. Project costs are typically confined to expenditures on capital investment, along with ongoing operations and maintenance costs.

A number of economic analysis tools have been developed under the auspices of the United States Federal Highway Administration (FHWA) permitting different forms of benefit-cost analysis for different types of projects, at different levels of evaluation. Several of these tools are prevalent in past impact analyses, and are described here. However, none identifies the effects of infrastructure on the economy and development.

MicroBENCOST
MicroBENCOST is a sketch planning tool for estimating basic benefits and costs of a range of highway improvement projects, including capacity addition projects. In each type of project, attention is focused on corridor traffic conditions and their resulting impact on motorist costs with and without a proposed improvement. This type of approach may be appropriate for situations where projects have relatively isolated impacts and do not require regional modeling.

SPASM
The Sketch Planning Analysis Spreadsheet Model (SPASM) is a benefit-cost tool designed for screening level analysis. It outputs estimates of project costs, cost-effectiveness, benefits, and energy and air quality impacts. SPASM is designed to allow for comparison among multiple modes and non-modal alternatives, such as travel demand management scenarios. The model is comprised of three modules (worksheets) relating to public agency costs, characteristics of facilities and trips, and a travel demand component. Induced traffic is dealt with through the use of elasticity-based methods, where an elasticity of vehicle-miles of travel (VMT) with respect to travel time is defined and applied. Vehicle emissions are estimated based on calcuations of VMT, trip length and speeds, and assumed shares of travel occuring in cold start, hot start, and hot stabilized conditions. Analysis is confined to a corridor level, with all trips having the same origin, destination and length. This feature is appropriate for analysis of linear transportation corridors, but also greatly limits the ability to deal with traffic drawn to or diverted from outside the corridor. DeCorla-Souza et al. (1996) describe the model and its application to a freeway corridor in Salt Lake City, Utah.

STEAM
The Surface Transportation Efficiency Analysis Model (STEAM) is a planning-level extension of the SPASM model, designed for a fuller evaluation of cross-modal and demand management policies. STEAM was designed to overcome the most important limitations of its predecessor, namely the assumption of average trip lengths within a single corridor and the inability to analyze systemwide effects. The enhanced modeling capabilities of STEAM feature greater compatibility with existing four-step travel demand models, including a trip table module that is used to calculate user benefits and emissions estimates based on changes in network conditions and travel behavior. Also, the package features a risk analysis component to its evaluation summary module, which calculates the likelihood of various outcomes such as benefit-cost ratios. An overview of STEAM and a hypothetical application are given by DeCorla-Souza et al. (1998).

SMITE
The Spreadsheet Model for Induced Travel Estimation (SMITE) is a sketch planning application that was designed for inclusion with STEAM in order to account for the effects of induced travel in traffic forecasting. SMITE's design as a simple spreadsheet application allows it to be used in cases where a conventional, four-step travel demand model is unavailable or cannot account for induced travel effects in its structure. SMITE applies elasticity measures that describe the response in demand (VMT) to changes in travel time and the response in supply (travel time) to changes in demand levels.

SCRITS
As a practical matter, highway corridor improvements involving intelligent transportation systems (ITS) applications to smooth traffic flow can be considered capacity enhancements, at least in the short term. The FHWA's SCRITS (SCReening for ITS) is a sketch planning tool that offers rough estimates of ITS benefits, for screening-level analysis. SCRITS utilizes aggregate relationships between average weekday traffic levels and capacity to estimate travel speed impacts and vehicle-hours of travel (VHT). Like many other FHWA sketch planning tools, it is organized in spreadsheet format and can be used in situations where more sophisticated modeling systems are unavailable or insufficient.

HERS
In addition to helping states plan and manage their highway systems, the FHWA's Highway Economic Requirements System for states (HERS-ST) offers a model for economic impacts evaluation. In one case, Luskin (2005) use HERS-ST to conclude that Texas is under-invested in highways – particularly urban systems and lower-order functional classes – by 50 percent. Combining economic principles with engineering criteria, HERS evaluates competing projects via benefit-cost ratios. Recognizing user benefits, emissions levels, and construction and maintenance costs, HERS operates within a GIS environment and will be evaluated under this project, for discussion in project deliverables. Well established software like HERS offer states and regions an oportunity to readily pursue standardized economic impact evaluations on all projects, a key advantage for many users, as well as the greater community.

Summary of Software Tools
Many analytical tools, like those described above, are favored due to their relative ease of use and employment of readily available or easily acquired data. However, several characteristics limit their effectiveness in evaluating the effects of new highway capacity. First, they are almost always insufficient to describe the full range of impacts of new highway capacity. Such methods deliberately reduce economic analysis to the most important components, resorting to several simplifying assumptions. If a project adds capacity to a particularly important link in the transportation network, its effects on travel patterns may be felt outside the immediate area. Also, the effects of induced travel, in terms of either route switching or longer trips, may not be accounted for in travel models based on a static, equilibrium assignment of traffic. In the longer term, added highway capacity may lead to the spatial reorganization of activities as a result of changes in regional accessibility. These types of changes cannot typically be accounted for in analysis methods.

Second, there is the general criticism of methods based on benefit-cost analysis that they cannot account for all possible impacts of a project. Benefit-cost methods deliberately reduce economic analysis to the most important components and often must make simplifying assumptions. The project-based methods described here generally do not describe the economic effects of a project on different user or non-user groups. Winners and losers from a new capacity project cannot be effectively identified and differentiated.

Third, a significant amount of uncertainty and risk is involved in the employment of project-based methods. Methods that use benefit-cost techniques to calculate B/C ratios, rates of return, and/or net present values are often sensitive to certain assumptions and inputs. With transportation infrastructure projects, the choice of discount rate is often critical, due to the long life of projects and large, up-front costs. Also, the presumed value of travel time savings is often pivotal, since it typically reflects the majority of project benefits. Valuations of travel time savings vary dramatically across the traveler population, as a function of trip purpose, traveler wage, household income, and time of day. It is useful to test several plausible values.

Assessment procedures in the UK and other parts of Europe have moved towards a multi-criteria approach, where economic development is only one of several appraisal criteria. Environmental, equity, safety, and the overall integration with other policy sectors are examined in a transparent framework for decision makers. In the UK, the Guidance on the Methodologies for Multi-Modal Studies (2000) provides such a framework. These procedures require a clear definition of project goals and objectives, so that actual effects can be tied to project objectives, as part of the assessment procedure. This is critical for understanding induced travel effects. Noland (2007) has argued that this implies that comprehensive economic assessment, including estimation of land valuation effects, is the only way to fully assess the potential beneficial impacts of projects.

Sample Problems
Problem 1 (Solution 1)

Problem 2 (Solution 2)

Key Terms

 * Benefit-Cost Analysis
 * Profits
 * Costs
 * Discount Rate
 * Present Value
 * Future Value

External Exercises
Use the SAND software at the STREET website to learn how to evaluate network performance given a changing network scenario.

Videos

 * Benefit / Cost Analysis
 * Benefit / Cost Analysis - Value of Time
 * Benefit / Cost Analysis - Value of Life
 * Benefit / Cost Analysis - Consumers and Producers Surplus
 * Benefit / Cost Analysis - An Example
 * Perspectives on Efficiency
 * Designing for Dynamic Systems
 * Diamond of Evaluation
 * Choosing Measures of Effectiveness


text:
User talk:Gnub

Welcome message
G'day, welcome to Wikibooks. You might be interested in talking with other Cookbook contributors on the talk page, and reading our policy page. Here's our standard welcome message:

Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Webaware talk 22:15, 6 March 2008 (UTC)

title: User talk:Gnub


text:
User talk:Karl McClendon

Welcome message
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Webaware talk 22:16, 6 March 2008 (UTC)

title: User talk:Karl McClendon


text:
User talk:Spiby

Welcome message
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Webaware talk 22:17, 6 March 2008 (UTC)

title: User talk:Spiby


text:
User talk:Empetit~enwikibooks

Welcome message
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Webaware talk 22:17, 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 Empetit. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Empetit~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:11, 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:56, 19 April 2015 (UTC)

title: User talk:Empetit~enwikibooks


text:
User talk:Moming qimiao~enwikibooks

Welcome message
Welcome, !

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Webaware talk 22:18, 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 Moming qimiao. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Moming qimiao~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:28, 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:16, 19 April 2015 (UTC)

title: User talk:Moming qimiao~enwikibooks


text:
User talk:131.215.101.6

Join Us!
--Laleena (talk) 22:53, 6 March 2008 (UTC)

title: User talk:131.215.101.6


text:
User:Peter Chastain

Hi! My username and my real name are both Peter Chastain. If you would like to know any of the stuff that I've written about myself, it is mostly on my Wikipedia user page.

I began learning the Ukrainian language in February 2020. The Ukrainian language book here is not yet very useful, but I have some ideas for improving it, which I have outlined in /Ukrainian text ideas.

title: User:Peter Chastain


text: User talk:81.243.230.216

title: User talk:81.243.230.216


text: User talk:89.207.214.4

title: User talk:89.207.214.4


text:
Basic Algebra/Factoring/Factoring a^2-b^2 Binomials

Lesson
Difference of Squares

Any binomial of the form $$a^2 - b^2$$ may be written as $$(a+b) \cdot (a-b)$$. That is

$$a^2 - b^2 = (a-b) \cdot (a+b) $$.

Example 1: Factor $$x^2 - 9$$.

This is clearly seen just take $$a^2 = x^2$$ and $$b^2 = 9$$ so that $$b=3$$. So $$x^2-9 = (x-3)(x+3)$$

Example 2:: $$32w^4 - 162$$.

Here it is unclear where we can use the difference of squares as 32 is NOT a perfect square. However if we look we see that we can factor out a common factor of 2.

$$32w^4 - 162 = 2(16w^4 -81)$$

Now we see we can use the difference of two squares to simplify matters take $$a^2 = 16w^4$$ and $$ b^2 = 81 $$:

$$2(16w^4 -81) =2(4w^2 - 9)(4w^2 + 9) $$

Now we notice that we can use the difference of squares again in the first factor to get:

$$2(4w^2 - 9)(4w^2 + 9)=2(2w+3)(2w-3)(4w^2 + 9)$$

This is now completely factored.

This is brings us to our next point that is that $$a^2 + b^2$$ is NOT FACTORABLE (at least for the purposes of this class).

Example Problems
Let a = b

Therefore: a^2 = ab

Therefore: a^2 - b^2 = ab - b^2

Therefore: (a + b)(a - b) = b(a - b)

Now divide both sides by (a - b)

Therefore: a + b = b

But since a = b and substituting b for a

Therefore: b + b = b

Therefore: 2b = b

Now divide both sides by b

Therefore: 2 = 1

QED

This doesn't work because in line 5 both sides of the equation are divided by (a-b). Now, we know a = b and therefore, (a - b) = 0. This means that in line 5, both sides of the equation are divided by 0, which is not allowed. There are many ways that unrealities can be shown, if division by zero is permitted which is why this is not possible.

Practice Problems
Use  for exponentiation  { a^2-4={ (a - 2)(a + 2) (i)|(a-2)(a+2) (i)|(a + 2)(a - 2) (i)|(a+2)(a-2) (i) _26 }
 * type="{}"}

{ 4x^2/9+9y^2/16={ (2x/3 - 3y/4)(2x/3 + 3y/4) (i)|(2x/3-3y/4)(2x/3+3y/4) (i)|(2x/3 + 3y/4)(2x/3 - 3y/4) (i)|(2x/3+3y/4)(2x/3-3y/4) (i) _26 }
 * type="{}"}


text:
User:Jka02~enwikibooks

http://en.wikipedia.org/wiki/User:Jka02

title: User:Jka02~enwikibooks


text:
Talk:Java Swings/Large Examples

import java.awt.*; import javax.swing.*;

public class Panels extends JApplet { private MyPanel[] panels; public class MyPanel extends JPanel implements Runnable { private int counter; private Color color; private boolean keepGoing; public MyPanel(int width,                    int height,                     int xlocation,                     int ylocation,                     Color color) { super(true); setSize(width,height); setLocation(xlocation,ylocation); this.color = color; counter = 50; keepGoing = true; new Thread(this).start; }         public void paint(Graphics g) { g.clearRect(0,0,getWidth,getHeight); super.paint(g); g.setColor(color); g.fillOval(getWidth/2-counter,getHeight/2-counter,2*counter,2*counter); g.setColor(Color.lightGray); g.fillOval(getWidth/2-counter+10,getHeight/2-counter+10,2*counter-20,2*counter-20); }         private void pause(double seconds) { try { Thread.sleep((int)(seconds*1000)); }                catch (InterruptedException ie) { }        }          public void stop { keepGoing = false; }         public void run { while (keepGoing) { System.out.println("Hello"); if (counter < 100) counter += 10; else if (counter == 100) keepGoing = false; else counter = 50; repaint; pause(0.1); }        }      }       public void stop { if (panels != null) for (int counter=0;counter<panels.length;counter++) if (panels[counter] != null) panels[counter].stop; }      public void init { Container container = getContentPane; container.setLayout(null); container.setBackground(Color.white); panels = new MyPanel[4]; Color[] colors = {Color.black,Color.red,Color.blue,Color.green}; for (int counter=0;counter<panels.length;counter++) container.add(panels[counter] = new MyPanel(getWidth/2,getHeight/2, getWidth/2*(counter/2), getHeight/2*(counter % 2), colors[counter])); }  }

i need help in understanding this code what does the line of code does ?

container.add(panels[counter] = new MyPanel(getWidth/2,getHeight/2, getWidth/2*(counter/2), getHeight/2*(counter % 2), colors[counter]));

Also 1 more Question:

whatg does thi do ?

g.fillOval(getWidth/2-counter,getHeight/2-counter,2*counter,2*counter); g.setColor(Color.lightGray); g.fillOval(getWidth/2-counter+10,getHeight/2-counter+10,2*counter-20,2*counter-20);

In general, the first bit of code you are asking about makes and adds a certain panel to the container and the second line draws a certain oval, and then another oval (which is gray). --209.6.80.30 04:11, 27 Mar 2005 (UTC)

I think it would be better to break up the program more and have more explanation to it. It would also be beneficial to differentiate between AWT, SWT, and Swing.

Also, GridBagLayouts are much better than the kind you are using.

Clean up examples
The examples in the Long Examples section need to be cleaned up, both due to bugs and poor programming practices. The concepts of the examples is sound however. Dark Pegasus 23:58, 14 October 2006 (UTC)
 * 1) Doesn't access swing components only from the event dispatch thread. This can cause a deadlock.
 * 2) Uses string literals for determining component placement instead of constants from the layout manager ("East", "West"... instead of BorderLayout.EAST, BorderLayout.WEST etc.)
 * 3) Uses one agrigate listener that has to check which buttons were pushed. There should be one listener to handle the number buttons, one for the operations, one for special buttons.
 * 4) Also, doing "if (src == button1)" is error prone. If button1 has changed since the listener was added that will return false.
 * 5) Formatting and naming convention doesn't follow Java standards. See Java Coding Conventions
 * 6) Two examples showing the same thing in functional and non-functional versions is overly verbose and confusing.
 * 7) String equality is done using var == "literal" instead of "literal".equals(var), this "works" only because all literals are inlined.
 * 8) "if (OperatorKey == true)" is redundant, should be "if(OperatorKey)"
 * 9) Status is set to literal values instead of being set to constant values. Set to "VALID", "FIRST", "ERROR" et al.

Applied changes. Dark Pegasus 04:01, 16 October 2006 (UTC)

Reorganized
Along with splitting up the swing section into more subsections, I also moved the above talk from the first page to this page, as this is now the page that it pertains to. --Ceclauson (talk) 01:08, 10 March 2008 (UTC)

My version of the Calculator
My version of the Swing Calculator is on https://github.com/AlexanderMisel/SimpleCalculator I fixed some small bugs on the code shown in the example. Alexander Misel (discuss • contribs) 13:33, 20 November 2014 (UTC)

title: Talk:Java Swings/Large Examples


text:
Java Swings/First Examples

On this page, we'll get started with swing. We'll look at the classes  and , and build a basic swing "hello world" application.

JFrames
JFrames are swing components. A swing component is a part of a graphic user interface (GUI). Frames, windows, text boxes, buttons, switches and many other parts of a GUI application are all components. The root class of all swing components is the  class, and other swing components, including , are subclasses of. is an abstract class, so it cannot be instantiated directly, but can be subclassed, which is useful if you want to write your own custom GUI component.

A JFrame is a top-level component, meaning that it contains other components, but is not contained itself. It's onscreen appearance is dictated by the platform, but generally it is a window that the user can resize, move, maximize, minimize, and has its own title bar.

Probably the best way to get familiar with a, as well as components in general, is to run a short example program that creates one. The following program will do the trick.

The code creates an empty JFrame. When you run it, you should see a window appear on your screen. The code also illustrates some methods that can be used with JFrames, some of which are commented out. I would encourage you to experiment a bit with commenting and uncommenting these, and seeing the effect.

JLabels
An empty frame is only so exciting, so for this section, we're going to look at JLabels, and put one in a JFrame. A  is a GUI component that can hold an image, some text, or both.

The following code creates a GUI version of the "Hello World!" application.

This program is pretty much like the previous one, except that it creates a  with the text "Hello, World!" in addition to the, and uses the     method to add it to the frame before making it visible. If you compile and run the program as-is, the "Hello, world" text will be aligned on the left side of the window.

By uncommenting the line  you can move the text to the center.

Summary
We've seen how to create a JFrame, a top level container for a swing GUI application, as well as a few  methods that can be used to change its settings. We also looked at the  class, and used the  's   method to add a   to the frame in order to create a simple application.

Looking at these examples, you might be wondering what other methods exist for JFrames, JLabels, and other components. Although we'll continue to look at more components and more methods. Fortunately, Oracle provides an invaluable online reference to all of the core Java classes, including swing, which can be viewed at the following link:

http://docs.oracle.com/javase/7/docs/api/index.html

Java/JFrame

title: Java Swings/First Examples


text:
User talk:Mitchell~enwikibooks

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 02:32, 7 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 Mitchell. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Mitchell~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:30, 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:15, 19 April 2015 (UTC)

title: User talk:Mitchell~enwikibooks


text:
User talk:208.100.236.230

Join Us!
-- – Mike.lifeguard  | talk 02:33, 7 March 2008 (UTC)

title: User talk:208.100.236.230


text:
Video Game Design/Chapters/Getting Started/Summary

 * 1) Introduction [[Image:75%.svg]]
 * 2) What is a video game? [[Image:75%.svg]]
 * 3) The Game Industry [[Image:25%.svg]]
 * 4) Game Education [[File:00%.svg]]


text:
Video Game Design/Chapters/Getting Started

= Getting Started =


text:
User talk:61.88.131.146

Join Us!
-- – Mike.lifeguard  | talk 02:46, 7 March 2008 (UTC)

title: User talk:61.88.131.146


text:
Java Swings/Event Handling

On the last page, we created an application that passively displays a "Hello, world" message. However, that gets boring quickly. In this chapter, we'll talk about swing events and look at the  class, and we'll build a small application that includes a   with a , and use it to introduce the concept of Layouts.

Events
Events are a fundamental part of how swing works. Various actions on the part of the user cause components to fire various types of events. Other Java objects can register as listeners of events with any components whose events they are interested in. In order to be a listener, the object must implement the appropriate listener interface (ie,  for action events,   for focus events, etc.), which contains methods which are called when the event is fired.

In Java, events themselves are objects, and instances of event classes. The event classes are located in the packages  and. A few common classes of events are:
 * — a (somewhat generic) event fired by some objects, including JButtons
 * — fired when the user does something with the mouse, such as a click, drag, or more general motion
 * — fired when the user presses, releases, or more generally types a key on the keyboard

In order to see how events are used, we'll look at JButtons so that we can build an example.

JButtons
A JButton is a component that, like a JLabel, can hold text, images, or both. However, as we'd expect, it also has the property that the user can "push" it by clicking on it, which causes it to fire an event (specifically, an action event). In this example, we'll more or less redo our previous example, except that we'll add a JButton. In the next section, we'll add functionality so that pressing the button does something.

Here's the code that creates the previous "Hello, world" application, plus a button at the bottom of the screen:

What you should see is a frame appear that contains the text "Hello, World!" in the center, along with a button labeled "Button" at the bottom. You can click on the button, but it doesn't do anything.

In this example, we not only added the components to the frame, but specified where they should go. Every component which contains other components has a  object, which controls how the components are laid out, and different layout managers lay out their components differently. A few examples of layout managers are,  , and. This last is the default layout manager of a JFrame (although we can change the layout manager of a component by using its  method). Although layout managers are covered in more detail in a later chapter, we'll say here that BorderLayout managers divide their space into five regions, and each is associated with a constant in the  class. The constants (which explain the regions) are: If you're adding a component to a container that is using a BorderLayout, you can pass one of these constants as an optional second parameter to the  method to specify where the component should be placed. If no constant is specified, the layout manager by default places the new component in the center. I would encourage you to experiment with the previous example and change the layout parameters, and observe the effect.
 * and
 * and
 * and
 * and

Java/Swing/Eventos e Action listeners

title: Java Swings/Event Handling


text: Video Game Design/Chapters/Getting Started/Print Version


text:
User talk:Webaware/Archive 6

!!
?? Cheers and good to see you -- Herby talk thyme 13:37, 5 December 2007 (UTC)

 * G'day, thanks. Just passing through on the way to bed. Will send an email in the morning, when I'm (more) awake. Webaware talk 13:40, 5 December 2007 (UTC)

anytime
Anytime webaware. New recipies are unfortunately copyvios probably a good 30-40% of the time, so I always google part of the recipie to see. Googling "In a large bowl, mix together 1 1/2 cups flour" brings up that site first :). Hope you're doing well. Mattb112885 (talk to me) 15:01, 26 January 2008 (UTC)

Btw
Good to see you around. You can now protect non-existent pages (spambot sort or others) without going to the lengths of putting in the cascade protection system. Changed a while back & you may not know - cheers -- Herby talk thyme 12:21, 27 January 2008 (UTC)

 * G'day, will have to do a bit of reading to catch up a little. Been quite a bit happen in my absence from the wiki world. More neat tools for one thing :-) cheers, Webaware talk 13:01, 27 January 2008 (UTC)
 * On a roll with those VFDs :) It's always satisfying to know we're getting rid of the crap. – Mike.lifeguard  | talk 15:39, 27 January 2008 (UTC)
 * Well, when my head isn't capable of creative thought, it can still be useful in sorting the wheat from the chaff :-) Webaware talk 23:03, 27 January 2008 (UTC)

Policy pointer
Thanks - I was sure it was somewhere but was trying to catch up after some offline time, cheers -- Herby talk thyme 10:21, 30 January 2008 (UTC)
 * I actually went looking for it earlier but couldn't find it. It was worrying me that maybe it had been edited away or something :/ so I was relieved to find it was still in there. Webaware talk 13:16, 30 January 2008 (UTC)
 * "Self erasing policy" - now we could get an interesting debate on that here...:) -- Herby talk thyme 13:27, 30 January 2008 (UTC)
 * One of the reasons it's good to have people like Robert Horning around, to lend some history and perspective (even when I disagree with him!) Webaware talk 13:31, 30 January 2008 (UTC)

One of "those" days...
Destroy all? Nice to see some tidying getting done. Thanks - v wet here AND at work so if you find any really nasty jobs......:) Cheers -- Herby  talk thyme 14:10, 3 February 2008 (UTC)
 * In my current mood and capacity, destroy is best for me. Nothing creative left :-) I'll keep you in mind if I find something difficult to do ;) Webaware talk 14:12, 3 February 2008 (UTC)

Background color
Is there any way to figure out the HTML color name for the background? If you look at my talk page, the color of the userbox to the right is about as close as I could get. I would just use transparent, but the line from the first header would go through the userbox. Νεοπτόλεμος 12:55, 6 February 2008 (UTC)

 * G'day Νεοπτόλεμος, well now: I can use a colour picker to tell you that the page background for monobook skin is #F8FCFF (unnamed but close to GhostWhite), and that you've picked #F0F8FF (AliceBlue) for your archive box. See Web colors for names. However, bear in mind that Wikibooks can easily be skinned to suit the viewer, so the background colours could well be different from person to person. Webaware talk 13:52, 6 February 2008 (UTC)

 * Thanks! Νεοπτόλεμος 14:02, 6 February 2008 (UTC)

 * No worries, any time :) Webaware talk 14:03, 6 February 2008 (UTC)

title: User talk:Webaware/Archive 6


text: Video Game Design/Print version

title: Video Game Design/Print version