Download as pdf or txt
Download as pdf or txt
You are on page 1of 104

PROJECT NUMBER CS-DCB-9611

THE USE OF AGENTS IN NEWSPAPER LAYOUT

A MAJOR QUALIFYING PROJECT REPORT


SUBMITTED TO THE FACULTY OF THE

WORCESTER POLYTECHNIC INSTITUTE


IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE

DEGREE OF BACHELOR SCIENCE


BY

___________________ DAVID M. KOELLE

MAY 1, 1997

APPROVED:

____________________________ PROFESSOR DAVID C. BROWN, MAJOR ADVISOR 1. Agents 2. Newspaper 3. Layout

Abstract
Creating the layout of a newspaper page is a tedious and time consuming process that employs a set of rules and guidelines. A program which can create layout designs would be a valuable tool. This project analyzes current methods of creating layouts and builds a system using an agent-based approach. The resulting pages were evaluated by experts and laypeople according to aesthetics and adherence to guidelines. The system designed layouts that were used in Newspeak, the student newspaper of WPI.

Acknowledgments
I wish to thank my advisor, Dr. David C. Brown, for all of his guidance and hard work. His encouragement and constant challenges inspired me and pushed me to extend my capabilities to their furthest. Dr. Brown always made time to answer my questions and kept me informed of new developments in the field. Thanks to Dan Grecu, who helped me with some of the concepts of agents, and who supplied me with lots of important papers to examine. I would like to thank everyone at Newspeak who has helped me along the way, whether through helpful advice or thoughts on how Avalon might work better. I would also like to express my gratitude to the Newspeak layout staff, who let me use Avalon to lay out five pages of the newspaper. Thanks to James Keast, a student at Dalhousie University who is one of the few people in the world also doing work in newspaper layout generation. James made my MQP a referenced paper before it was even complete! I would also like to thank those who responded to my evaluation page on the World Wide Web. Without your help, I could not have been as confident about the quality of Avalons layouts. Last but certainly not least, I would like to thank friends and family, without whose moral support this project would not have been possible.

ii

Table of Contents
1. PROBLEM DESCRIPTION ....................................................................................................................1 1.1 INTRODUCTION ...........................................................................................................................................1 1.2 WHAT IS THE CHALLENGE OF NEWSPAPER LAYOUT?...................................................................................2 1.3 WHAT IS A CONFIGURATION PROBLEM? ......................................................................................................4 1.4 WHAT IS A CONSTRAINT SATISFACTION PROBLEM?....................................................................................6 1.5 WHAT IS AN AGENT?...................................................................................................................................9 1.6 MOTIVATION BEHIND USING AGENTS TO SOLVE A DCSP ..........................................................................11 2. ABOUT NEWSPAPER LAYOUT .........................................................................................................13 2.1 THE PAGE .................................................................................................................................................13 2.2 PARTS OF A NEWSPAPER PAGE ..................................................................................................................14 2.3 WAYS TO MANIPULATE ITEMS...................................................................................................................15 2.4 ITEM CLASSES AND INHERITANCE .............................................................................................................17 2.5 GENERAL LAYOUT GUIDELINES .................................................................................................................18 3. DEFINING THE PROBLEM.................................................................................................................19 3.1 PROBLEM STATEMENT ..............................................................................................................................1 9 3.1.1 The items................................................................................................................ ..........................19 3.1.2 Operations to traverse the solution space................................................................................ ........20 3.1.3 The goal, and how to test for goal satisfaction ................................................................................20 3.2 HOW TO TRAVERSE THE SEARCH SPACE FOR AN ACCEPTABLE LAYOUT.....................................................20 3.3 EXISTING WORK IN SEARCHING FOR AN ACCEPTABLE LAYOUT ..................................................................21 3.3.1 Constraint Propagation in a Cooperative Approach for Multimodal Presentation Planning.........21 3.3.2 Layout Construction: A Case Study in Algorithm Engineering .......................................................23 3.3.3 Newspaper Layout Aesthetics Judged by Artificial Neural Networks..............................................24 3.3.4 Automatic Layout Tool.....................................................................................................................25 3.3.5 Summary ..........................................................................................................................................27 4. DESIGN OF THE SYSTEM...................................................................................................................28 4.1 INTRODUCTION TO AVALON .....................................................................................................................28 4.2 LIMITING THE SCOPE OF THE PROBLEM .....................................................................................................28 4.3 AGENTS AND SUBAGENTS .........................................................................................................................29 4.4 ABSTRACTION OF ARTICLES ......................................................................................................................31 4.5 DESIGN OF THE SYSTEM ............................................................................................................................32

iii

4.6 COMMUNICATION .....................................................................................................................................34 4.6.1 Posting to a bulletin board ..............................................................................................................34 4.6.2 Direct communication between agents ............................................................................................35 4.6.3 Communication through an agent hierarchy ...................................................................................36 4.6.4 Form of the message ........................................................................................................................38 4.7 GOAL TESTING ..........................................................................................................................................41 4.8 AN EXAMPLE ............................................................................................................................................43 4.9 SEARCHING THE SPACE OF POSSIBLE CONFIGURATIONS.............................................................................47 4.10 PARTS OF THE PROGRAM ........................................................................................................................47 4.10.1 Send ...............................................................................................................................................48 4.10.2 Arranging articles using Quicksort................................................................................................48 4.10.3 Best spot finder (FindSpot) ............................................................................................................48 4.10.4 Reshaper ........................................................................................................................................49 4.10.5 Shrinking and expanding, and automatic tracking ........................................................................49 4.10.6 MAIN, the Layout Manager; swapping and backtracking ..............................................................50 5. IMPLEMENTATION .............................................................................................................................52 5.1 DATA FILE SPECIFICATIONS .......................................................................................................................52 5.1.1 Avalon 1.0 item file ..........................................................................................................................52 5.1.2 Introduction to Avalon 2.0 files .......................................................................................................52 5.1.3 Page settings file..............................................................................................................................53 5.1.4 Item input file...................................................................................................................................54 5.1.5 End of the files .................................................................................................................................55 5.1.6 Sample files......................................................................................................................................55 5.2 ACCESSORY PROGRAMS ...........................................................................................................................56 5.2.1 Random Article Generator (RAG) ...............................................................................................56 5.2.2 Display program (Proof) .............................................................................................................57 5.3 DECISION ON PROGRAMMING LANGUAGE .................................................................................................58 6. TESTING AND EVALUATION ............................................................................................................60 6.1 TEST CASES ..............................................................................................................................................60 6.2 ADHERENCE TO LAYOUT RULES AND GUIDELINES .....................................................................................62 6.3 QUALITY OF OUTPUT.................................................................................................................................62 6.4 EVALUATION FORM ON THE WORLD WIDE WEB ......................................................................................64 6.4.1 Contents of the evaluation pages .....................................................................................................64 6.4.2 Responses to Web page....................................................................................................................65 6.4.3 Analysis of Web responses ...............................................................................................................65

iv

6.5 FIRST ATTEMPT AT LAYING OUT PAGES OF A REAL NEWSPAPER.................................................................66 6.5.1 The first page ...................................................................................................................................67 6.5.2 The second page ..............................................................................................................................68 6.5.3 The third page..................................................................................................................................69 6.5.4 Analysis............................................................................................................................................70 6.5.5 Creation of Avalon 2.0.....................................................................................................................71 6.5.6 Laying out the previous pages with Avalon 2.0 ...............................................................................71 6.5.7 Second attempt at laying out pages of a real newspaper.................................................................72 7. ANALYSIS AND CONCLUSION..........................................................................................................74 7.1 STRENGTHS AND WEAKNESSES OF AVALON..............................................................................................74 7.1.1 Weakness in functionality ................................................................................................................74 7.1.2 Weakness in architecture .................................................................................................................74 7.1.3 Strength in system design.................................................................................................................74 7.1.4 Ambivalence towards system design ................................................................................................75 7.2 ADDITIONAL WORK...................................................................................................................................75 7.2.1 Working with a greater set of items .................................................................................................75 7.2.2 Expanded communication abilities and a more intelligent MAIN agent...........................................76 7.2.3 Bidding for space among agents......................................................................................................76 7.2.4 Enhanced representation of the page ..............................................................................................77 7.2.5 Ability to read actual articles ..........................................................................................................77 7.2.6 Extending the possibility of article shapes.......................................................................................77 7.2.7 More special requests for item positioning......................................................................................78 7.2.8 Recognizing article groups ..............................................................................................................79 7.2.9 Support for multiple pages...............................................................................................................79 7.2.10 Attaching items to other items........................................................................................................79 7.2.11 Touch-up functions ........................................................................................................................80 7.3 POSSIBLE USES .........................................................................................................................................80 7.4 MY MQP EXPERIENCE .............................................................................................................................81 7.5 CONCLUSION ...........................................................................................................................................82

APPENDIX A: EVALUATION FORM PLACED ON THE WEB ..........................................................................83 APPENDIX B: DATA GATHERED FROM EVALUATION FORM.......................................................................91 APPENDIX C: PAGES OF NEWSPEAK LAID OUT BY AVALON .......................................................................96 APPENDIX D: ADDITIONS AND CHANGES IN VERSION 2.0.........................................................................124 REFERENCES ...............................................................................................................................................130

Table of Figures
FIGURE 1.1 CONFIGURATION AND ARRANGEMENT .....................................................................................5 FIGURE 2.1 EXAMPLE OF A NEWSPAPER PAGE SHOWING SOME ITEMS .....................................................15 FIGURE 2.2 TRACKING ................................................................................................................................16 FIGURE 2.3 ITEM CLASSES AND INHERITANCE ...........................................................................................17 FIGURE 4.1 HIERARCHY OF AGENTS IN A POSSIBLE LAYOUT ....................................................................30 FIGURE 4.2 VIEWS OF THE MAIN AND ARTICLE AGENTS ...........................................................................32 FIGURE 4.3 THREE METHODS OF COMMUNICATION AMONG AGENTS .......................................................37 FIGURE 4.4 THE CURRENT CONFIGURATION FOR THE EXAMPLE SESSION ................................................45 FIGURE 4.5 THE FINAL CONFIGURATION FOR THE EXAMPLE SESSION ......................................................47 FIGURE 5.6 SAMPLE OUTPUT FROM PROOF................................................................................................58 FIGURE 6.1 SPACES WITH SAMPLE LAYOUTS ..............................................................................................63 FIGURE 7.1 A BENEFIT OF IRREGULARLY SHAPED ARTICLES ....................................................................78

Table of Tables
TABLE 4.1 COMMANDS WHICH MAY BE EXCHANGED AMONG AGENTS......................................................40 TABLE 4.2 RESPONSES WHICH MAY BE EXCHANGED AMONG AGENTS. .....................................................41 TABLE 4.3 LAYOUT ADVISORY MESSAGES..................................................................................................50

vi

1. Problem Description
1.1 Introduction
Creating the layout of a newspaper page is often a tedious and time consuming process that employs a set of rules and guidelines. Since the processes involved in newspaper layout can be broken down in this way, layout can be automated. To create layouts that are visually appealing and technically correct, it is also be necessary to implement an evaluating function to determine what layouts are acceptable. About two decades ago, newspapers were laid out entirely by hand. A layout staff used scissors, knives, rubber cement, and rulers to cut articles into pieces that fit together on a page. Things taken for granted today, such as automatic hyphenation and full justification of text, did not exist. Within the past decade, word processors and publishing programs for computers have automated many of the more menial tasks that were once the responsibility of the layout staff. These programs allowed the user to move and resize blocks of text, and they took care of basic tasks such as hyphenation. Knives and glue are no longer needed; today, the tool for layout is a mouse. While some of the processes involved in newspaper layout have been automated, the design of the page is still the responsibility of the layout staff. It takes a great deal of time and effort to determine where to place articles on a page. If a new tool could be created for layout, one that not only does the menial tasks but also lays out the actual page, page layouts or proposals for page layouts could be created in substantially less time, and with the same quality as a manually designed page. This does not mean that the layout staff is without a job; the layouts produced by such tools would probably need to be tweaked once they are created, and they would certainly have to be checked over for quality. This tool would also benefit organizations that cannot afford a layout staff. For example, sites on the World Wide Web that offer personalized newspapers could use this 1

tool to create electronic newspapers that can be laid out in a matter of seconds. Each subscriber, requesting only articles he or she wishes to read, would receive the articles laid out just as they would be in a paper newspaper; the service provider would not have to assign an individual layout artist to each personalized newspaper. This project report describes a system called Avalon that was developed as a demonstration of such a layout tool.

1.2 What is the challenge of newspaper layout?


In newspaper layout, a layout staff is given articles, photographs, and advertisements. We will assign the generic name items to those things that may be placed on a page; thus, items include headlines, articles, photographs, captions, advertisements, and other minor bits of information, such as bylines and continued from tags. The task of the staff is to create a page or pages on which all of this information is effectively laid out. This effective layout must follow the rules and guidelines for what a page should look like. The items on the page must also follow rules which state their relationships among other items: a caption must be next to the picture it describes, for example, or a headline must be placed to the top of is respective article. There is a difference between a rule and a guideline. A rule defines something which must be true. A layout is not acceptable if a rule is violated. A guideline, on the other hand, describes something which should be true; however, the final layout will still be acceptable if the guideline is not followed. Rules must be followed, guidelines should be followed if possible. Layout staffs typically do not know what items to expect to layout on a page from day to day. For this reason, it is often difficult to define concrete rules, because there is a great possibility that such a rule will be violated by a particular set of items. Some basic rules might be, Place large articles towards the top of the page, The photograph must appear next to the article it accompanies, or A headline goes over the article is describes. In many cases, rules are very obvious. However, it is still important that we 2

discuss what the rules of layout are, so the automated process has a definite way of placing items on a page. Guidelines are specifications which should be followed if possible things that are not necessary to create a legitimate layout, but which have the potential to make the layout better. Examples of guidelines might be, Place the photograph to the left or right of the article instead of the top or bottom, Try to prevent short four-column articles, Try to keep this photograph at its current size. Layouts which do not have these qualities are not improper, but they probably are not as good as they could be. Rules and guidelines for layout design have been composed by many sources throughout the history of publication. There are a vast number of rules and guidelines in existence, some of which are not agreed upon by all publications (a good example of this can be seen in headlines: most newspapers agree that only the first word of the headline and significant words thereafter should be capitalized; but the Wall Street Journal capitalizes most words in their headlines). Newspaper layout is a configuration problem: various resources, such as space, must be allocated to various entities requiring the resources, such as articles and photographs. Also, specific connections among items must be maintained in order for the final page to be acceptable. In a configuration problem, there may be many possible solutions, so a method of constraining the number of solutions must be implemented in order to direct the system to an acceptable solution. Thus, laying out a newspaper also incorporates some aspects of a constraint satisfaction problem. When laying out a

newspaper, a layout staff is constantly working with a limited amount of resources, trying to find the best way to place the articles which must be included in the paper. Each time an article is placed, the resulting possibilities for other article placements is further constrained.

1.3 What is a configuration problem?


A configuration problem is a problem in which an resources and an arrangement of objects using those resources is established. In the domain of newspaper layout, the main resource which must be allocated to items is space, and the arrangement of the resources is dictated by knowing what items on the page must be close to other items. Brown [1996] states that configuration can be logically broken down into several subtasks as follows: Configuration = Selection + Association + Arrangement + Evaluation Where: Selection is choosing which components to place in the configuration; Association is establishing logical relationships between the components; Arrangement is establishing specific relationships between components; Evaluation is testing for compatibility and goal satisfaction. The difference between association and arrangement is that Association states the logical relationships between objects, such as next to, inside of, or away from. Arrangement states the actual relationships between objects, which relate the position or function of one component directly to another: for example, two feet away from. To illustrate his point, Brown shows a three pulley system in two arrangements which have the same associations (see Figure 1.1). He later states that layout can be thought of as arrangement in two dimensions [Brown 1996].

B A

Pulley C Bel C

Figure 1.1 Configuration and Arrangement. Both pulley systems are configured in the same manner, but they have different arrangements [Brown 1996].

In the newspaper layout system, the main resource we are considering is space, but resources may be anything needed by an object in order to operate or to exist. Suppose, for example, we had a system which was to determine a layout for furniture in a room. The resources might consist of the availability of electrical outlets or data

hookups. The proper configuration for such a system would put a lamp near one of the outlets, for example, or the computer near the data hookup. The problem would be further complicated by the existence of other furniture, the length of electrical cords, and so forth. It may be impossible, for example, for the lamp to be right next to the electrical outlet since the sofa is already there and it cannot move. But the lamp might have a six foot electrical cord, so it can move anywhere around the room as long as it is within six feet of the outlet. Details are starting to be defined in the system which restrict the final layout of the room. The restrictions placed on the

arrangement of furniture gives the problem the property of a constraint satisfaction problem.

1.4 What is a Constraint Satisfaction Problem?


A constraint is a limit on a variable or group of variables. A constraint

satisfaction problem (CSP) is one in which a set of variables and constraints on those variables is given, and values for the variables must be found which fall within the constraints. For example, consider the problem:

Given the variables x and y, and the constraints x + y = 20 x > 10 y<2 Find values for x and y such that the constraints are satisfied.

Here, the set of variables consists of x and y. The constraints on the variables are x + y = 20, x > 10, and y < 2. Values for x and y must be found which satisfy these constraints. Therefore, even though 5 + 15 = 20, assigning 5 to x and 15 to y is not acceptable, since these values do not satisfy the other constraints in the problem, which state that x must be greater than 10 and y must be less than 2. The solutions for the preceding problem are [x = 19, y = 1] and [x = 20, y = 0] (With the assumption, of course, that we are working with positive whole numbers and zero). Note that the solutions for the variables x and y must be given as a pair. It is not true that x = 19, y = 0 satisfies the problem; even though 19 > 10 and 0 < 2, 19 + 0 = 20 is not true. The possible solutions to a CSP comprise a solution space. The constraints in a CSP allow the solution space to be reduced from a large space to a smaller space. If we were given only the variables x and y and told to assign numbers to them, the solution space is infinitely large. The constraint x + y = 20 reduces the number of possibilities that x and y could be. Constraining the system further, by stating x > 10 and y < 2, narrows the solution space even more.

If the solution space for a CSP were so large that it would be difficult or impossible to select an acceptable solution, the system would be underconstrained. There would not be enough restrictions on the system, and the possible solutions would be too numerous to consider (indeed, they would be infinite). As more restrictions are placed on the system, the solution space becomes more constrained. If too many restrictions are placed on the system, it is overconstrained. Overconstraint leads to no possible solutions. For some problems, it is best to be able to pick a solution from a bunch of available solutions. In our x + y = 20 problem, it doesnt matter if we pick [x = 19, y = 1] or [x = 20, y = 0]. But suppose we were playing a type of mathematical Scrabble, and we only had one 19 tile left, but we had lots of 20 and 0 tiles. We would probably want to pick [x = 20, y = 0] as our solution, because we have so many of those tiles left. Thus, both solutions work, but an evaluation of the solutions shows that one is better than the other. Suppose our system is constrained just right. We have a set of possible solutions to a problem, and one of these might be better than the others. A method is needed for finding this preferred solution, and for that we turn to heuristics. A heuristic is a method used to assert a fact that we would like to be true for a particular system, but the solution of the system does not depend on it. A heuristic may be something which is told to the system initially, or it may be something learned by the system after applying various pieces of knowledge to a problem. For an example of heuristics, consider the following problem:

Given enough money for three scoops of ice cream (and the desire for no less than three scoops), the constraint I must have chocolate ice cream, and the heuristic, Selecting contrasting colors usually makes a sundae taste better, Buy an ice cream sundae

In this system, the initial set of configurations is all combinations of ice cream flavors offered by the ice cream parlor, including combinations that do not have three scoops or that do not have chocolate. A solution set is determined by constraining the set of possible configurations; thus, only those combinations that include chocolate ice cream are in the solution set. The heuristic helps find an acceptable sundae: the first configurations of ice cream to consider for the sundae will be those in the solution set that have scoops of contrasting color. A heuristic is a way to search a solution space without applying a constraint. In some cases (like the ice cream example above), a heuristic may be similar to a preference. This is especially true in problems which produce a result that has some aesthetic quality, such as selecting an ice cream flavor, or designing a newspaper layout. Although it might not always work, a heuristic is certainly worth a try. Perhaps the ice cream purchasing agent really dislikes strawberry ice cream, but finds to his dismay that this is exactly the type of ice cream contained in his three-scoop sundae. The purchaser did not like the sundae, but because he loves the taste of scoops with contrasting colors so much, the sundae with strawberry ice cream was worth a try.

In the example of laying out furniture in a room, each time a piece of furniture is positioned, the possible locations for other furniture is further constrained. For example, if the sofa is placed against the wall, nothing else can go next to the wall where the sofa is. If the coffee table is associated with the sofa so that it is always two feet away from it, this restricts the space in the room even further. Now, the comfy chair cant fit against the opposite wall, or else there would be no room for people to walk by. And the lamp always has to be near the comfy chair (so the person sitting in the chair can read in the evening), which means that the chair has to be within six feet of an electrical outlet, as does the lamp. This example exhibits the qualities of a dynamic constraint satisfaction problem (DCSP). Each time a piece of furniture is placed, further restrictions are put on the placement for the other pieces of furniture. The constraints on the final layout of the

furniture cannot be defined initially, since no furniture has been placed; constraints are dynamically established while the solution is being sought. This example also shows another important aspect of CSPs: the propagation of constraints. When a constraint is propagated, it is passed through the system. Lets use the furniture example again. Suppose the comfy chair had a hassock attached to it, and the chair was asked to move because it was blocking a walkway. The chair would also have to ask the hassock to move. In fact, the chair would probably ask the lamp to move as well, since the lamp is supposed to me next to the chair. The request to move was sent to the chair and propagated to the hassock and the lamp.

1.5 What is an agent?


The term agent is used to describe a wide variety of computer-based components which do some task with a certain degree of autonomy. There is no single, formal definition of an agent, but there are many characteristics which help to differentiate agency from other processes. Agents are a form of distributed artificial intelligence (DAI). DAI is a branch of artificial intelligence which deals with finding solutions to a problem using decentralized, concurrent processes. According to Torsun [1995], DAI can be broken into three

categories: distributed problem solving (also called cooperative distributed problem solving), in which a problem is decomposed among many specifically-designed knowledge-sharing modules; multi-agent systems, in which generally heterogeneous agents work together to solve a problem; and parallel artificial intelligence, the thrust of which is to create parallel computation languages and algorithms. However, says Torsun, there are no clear distinctions among these three areas, in part because there are no universally accepted definitions of these categories. There are specific qualities associated with agents. According to Torsun, agents are loosely coupled but are logically independent of each other. They can reason, plan, and communicate, and are capable of sophisticated problem solving. Wooldridge and 9

Jennings [1995] identify four qualities of agency: autonomy, social ability, reactivity, and pro-activeness. Franklin and Graesser [1996] attempt to define agency by citing

definitions obtained from a variety of sources. They isolate several properties which they consider necessary for agency. Like Wooldridge and Jennings, they suggest that an agent must possess autonomy, social ability, reactiveness, and pro-activeness. An agent must be autonomous. Autonomy allows an agent to respond to an action without being explicitly told to do so. The autonomy of an agent is one of the things that makes an agent different from a program [Franklin and Graesser, 1996]. Autonomy also dictates that an agent has some control over its actions. Agents must be socially able. They must be able to communicate with each other in order to know the needs, or to understand the requests, of other agents. In some cases, agents should communicate with humans as well. Torsun states, communication may be viewed as the maintenance of a collection of commitments among agents. Agents can also share information through communication. One way an agent decides its next course of action is by understanding the communications and actions of other agents. In order to do this, agents must be able to speak the same language. They must be able to understand requests, and be able to formulate proper responses to these requests. Agents must also possess reactiveness, which is the perception and response that makes an agent aware of, and a part of, its environment. Reactivity also includes acting in a timely manner to situations. Agents must be proactive. They must take the initiative to attain a goal.

Sometimes, agents use plans in order to reach their goals. A plan is an action sequence that allows the agent to achieve its goal [Russel and Norvig, 1995]. An agent must be an active part of its environment; it must be able to sense its environment, and it must be able to make changes to the environment or act on certain conditions. How the agent acts on its environment is determined by what it senses and what its goals are. There are other characteristics which agents may possess, but which are not crucial to agency. These are utility, the degree to which one state is preferred over 10

another, leading to higher quality behavior [Russel and Norvig, 1995]; mobility, the ability to move around; veracity, the assumption that an agent will not intentionally report false information; benevolence, the assumption that an agent does not have conflicting goals and can therefore do everything asked of it; and rationality, the assumption that an agent will act in order to achieve its goals and not act in ways that would inhibit its goals [Wooldridge and Jennings, 1995]. Additional aspects include adaptability, the capability of the agent to learn and adapt to situations; flexibility, the ability for agents to operate in different ways without being explicitly told what to do or how to act; and character, the capability of an agent to possess a believable personality and emotional state [Franklin and Graesser, 1996].

1.6 Motivation behind using agents to solve a DCSP


A dynamic constraint satisfaction problem requires that values for variables are found while changes are made to the system. Using agents would be an effective way to tackle such a problem, since agents possess the following important attributes: Communication. Agents can communicate with other agents. They can describe their needs and make requests of other agents. Local knowledge. Agents are experts with respect to the knowledge they contain about the objects they own. The agent who owns the lamp in the furniture example knows everything about the lamp: how long the electric cord is, how close it should be to the comfy chair, and so on. Negotiation ability. By using both communication and local knowledge, agents can effectively communicate their needs to each other and work out differences that might appear. Negotiation is useful in conflict resolution [Sycara, 1990]. Autonomy. Agents have the ability to figure a solution to a problem on their own. A layout system using agents would allow a human operator to enter articles and get as output a laid-out page.

11

Thus, the use of agents seems to be an ideal way to solve a DCSP. Since the problem is dynamic, it is especially important to have agents which can adapt to changes and negotiate so they can find solutions to problems as they arise.

12

2. About Newspaper Layout


Before discussing the approach of using agents to automate newspaper layout, it is important to discuss some of the terminology and ideas behind layout. This background will give a solid foundation in the way newspaper layouts are designed.

2.1 The page


To begin, we must define what a page is. On what size page will we be placing articles and other items? How are units on this page measured? A page is defined as being a certain number of columns wide, and a certain number of inches (or other metric) high. For our purposes, we will refer to the vertical measurement as units, since we do not want to be concerned about creating a perfect analogy between an existing metric and the metrics of this implementation. Suffice to say that a unit is analogous to an inch, and will be treated as such, except that we will not be concerned whether the unit is actually equal to an inch. Different newspapers are broken down into various numbers of columns and units. Sometimes, in fact, different pages of the same newspaper may be broken down into different numbers of columns. A column-unit is a measure of area on a page. An item which takes up x columns and y units occupies xy column-units. Items may take up the same number of columnunits while having different column and unit measures; for example, a twelve columnunit item may be one column by twelve units, two columns by six units, three columns by four units, or four columns by three units. We will abbreviate columns as c, units as u, and column-units as cu. There is a small space between columns which serves to physically separate columns of text. This space is referred to as a gutter. Our implementation will not be concerned with gutters, but they may be added simply by inserting a space between columns. 13

2.2 Parts of a newspaper page


There are a number of things which can be placed on a newspaper page. We will refer to these generically as items. Items may fall under categories according to what they are associated with; for example, a headline, byline, and continuation tags are all associated with an article. Items may be categorized in one of three groups. The types of items which may be placed are as follows.

Items in the Article Group Article: a block of text which contains a news story. Headline: a line of text describing the contents of an article. Drop Headline: a subtitle to the article, which is placed below the headline. Byline: a piece of text describing who wrote an article. Continuation Tag: a piece of text which says, continued on or continued from when an article must be continued on a separate page.

Items in the Photograph Group Photograph: an image which may be resized proportionally. Caption: A piece of text describing a photograph.

Items in the Miscellaneous Group Folio: line of text containing the page number and the name of the publication. Advertisement: an unresizable image. Masthead: an unresizable image which declares the name of the publication.

14

The MQP

Informer
Hundreds attend MQP demonstration
Automatic page layout should be a success
by Jim Smith Informer staff Earlier this year, two hundred people showed for a really awesome demonstration involving automatic page layouts, the result of a Major Qualifying Project written by WPI senior Dave Koelle. This project shows that it is possible for intelligent agents to design the layout for a newspaper page, Koelle said at a press conference which followed the presentation. Dave Koelle demonstrates his layout
see Demonstration, page 2 generating proogram at a presentation

Masthead Headline Drop Headline Byline

Photograph Caption Article Continuation Tag

Figure 2.1 Example of a newspaper page showing some items.

Often, some items may be attached to others. This means that the items are closely related, and should be physically close to each other on a page. For example, a photograph of the local citizen who just won a gold medal in the Olympics should be next to the article about this individual. The photograph is therefore attached to the article. Naturally, the photographs caption is attached to the photograph (it could be said that the photograph is attached to the caption, but since the photograph is the focus, we will attach the caption to the photograph).

2.3 Ways to manipulate items


Besides knowing what types of items can be put on a page, it is also important to know some of the methods and processes by which these items can be altered to make the best possible layout. The following are some terms that are concerned with manipulating items. Place: to put an item on a page.

15

Tracking: the space between letters in a piece of text. If the tracking is altered just a little, the change in spacing between letters is not very noticeable, but the net change in size of the text may be significant. See Figure 2.2.

A B C

The quick brown fox The quick brown fox jum The quick brown fox jumped o

Figure 2.2 Tracking. These text boxes demonstrate tracking, which changes the spacing between letters. A) Loose tracking. B) Normal tracking. C) Tight tracking.

Resize: to alter the area of an item. Articles may be resized by adjusting the tracking. Photographs must be proportionally resized. Other items, such as advertisements, cannot be resized. Proportional resize: resizing an image as to maintain its original width:height ratio. This type of resizing is done with photographs. Reshape: to alter the shape of an article without changing its shape. A 2cx6u article may be reshaped to 3cx4u; its size is still 12cu, but its shape is different.

For consistency within an article, the point size of the text is never changed, nor is the space between lines of text. Also, the font within a block of text is never changed. In fact, individual groups of items should typically maintain the same style of text for example, all article should have the same text style; all captions should have the same text style; but articles need not have the same text style as captions.

16

2.4 Item classes and inheritance


There are only two types of item classes that we are dealing with: text and image. Articles, headlines, bylines, and captions are all types of text, whereas photographs, advertisements, and mastheads are types of images. Because of this, we can give text or images characteristics which are shared by all items of that class. For example, since tracking is a method which can be applied to text, all types of text can use tracking. This means that we can develop specialized instances of text and image agents to handle the items. These agents would have similar basic knowledge (for example, that the tracking in text can be adjusted) while also having additional item-specific knowledge.

Text
Article Headline Drop Headline Byline Folio Caption

Continuation Tag

Image
Resizable Fixed Size

Photograph

Advertisement

Masthead

Figure 2.3 Item classes and inheritance. Items exhibit inheritance, where each item contains the attributes of its predecessor, as well as characteristics specific to each item.

17

2.5 General layout guidelines


We have the pieces of this problem: the page, the items, and relationships among items. We now need some guidelines for putting these pieces together in a coherent and acceptable layout. One such guideline establishes preferences as to what types of shapes are preferred in articles. For example, is a long and narrow shape better than a short and wide shape? In this system, articles should be as square as possible. If square shapes are not possible, then longer articles are preferred, followed by wider articles. It is better to have a long and narrow article than a wide and short one, but a square-shaped article is the best possible configuration. There is a limit to this, however; an article which is so long that it takes the entire length of the page is quite unattractive. Similarly, a wide article which is very short (for example, three lines deep in each column) would also be unappealing. This project will have a method of determining which configurations are acceptable and usable. Larger articles should go to the top of the page as a rule of thumb, since larger articles are usually more important. Larger articles at the top of a page make a page more attractive. Photographs should be resized proportionally, and there should be a limit to the size of a photograph not too large, and not too small. Also, photographs should be located next to the article they accompany. Photographs should be located towards the outside of the page.

18

3. Defining the Problem


The purpose of the program which will be developed as part of this project is to create a newspaper layout given a selection of articles. For the program to be

implemented effectively, we must first define what the problem is, and come up with solutions to solve it.

3.1 Problem statement


The problem statement explicitly declares what we have to start with, and what we want as an outcome. The problem statement for this system is as follows:

Given: A set of items which are to be placed on the page, A goal and evaluation criteria which establish what an acceptable configuration is, Criteria for deciding what operations to apply to the set of items to reach that goal, Build: A configuration of items which satisfies the evaluation criteria, or give a reason why the goal might not be satisfiable.

3.1.1 The items


This project will consider the placement of articles, advertisements, mastheads, and photographs. Some minor items, such as captions and continuation tags, are beyond the scope of this project.

19

3.1.2 Operations to traverse the solution space


The criteria for deciding which operations to apply consist of the ways to determine how to manipulate items on a page. Generally, the rules and guidelines of newspaper layout tell us that we might want to manipulate an item as well as how to manipulate it; the actual manipulations consist of the operations which can be applied to an item. An example of a guideline might be, Place the largest article towards the top of the page, and the method of doing so would be to send a Position command to the large articles agent.

3.1.3 The goal, and how to test for goal satisfaction


The goal in this case is an acceptable configuration of a newspaper layout. An acceptable configuration is achieved by passing the layout through various rules and guidelines without conflict.

3.2 How to traverse the search space for an acceptable layout


As the problem statement suggests, the initial state for this problem consists of a blank page and a series of items. Through applications of the rules and guidelines of layout, an acceptable layout the final state may eventually be reached. How does the system go from the initial state to the final state, and what criteria are used to test for correctness and acceptability along the way? The search space in this problem is the set of possible configurations. The operators used to move from one state to another consist of placement, movement, reshaping, and resizing, as constrained by the rules of the system.

20

3.3 Existing work in searching for an acceptable layout


Most of the facts which were used in devising the theory of this project and designing its implementation were derived from works which, while pertinent, did not directly relate to newspaper layout. While there is not much existing work on using intelligent agents in newspaper layout, the work which does exist presents some interesting ideas on theory and implementation. There are only four sources of

information regarding similar projects that I found, despite my extensive use of the library and the World Wide Web. Except for the Han and Zukerman paper, I became aware of these papers after I had designed and programmed Avalon, so it is interesting to see the similarities between these works and my own.

3.3.1 Constraint Propagation in a Cooperative Approach for Multimodal Presentation Planning


Yi Han and Ingrid Zukerman discuss their system, called MAGPIE (Multi Agent Generation of Presentations In Physics Education), which uses agents to present data [Han and Zukerman, 1996]. Han and Zukerman [1996] discuss work which has related constraint satisfaction to layout management. They review a system called WIP1, in which the layout manager considers constraints that result from the local relations between layout objects that are semantically connected, as well as global relations that consider the entire document. Han and Zukermans system, called MAGPIE, starts with a configuration containing constraint violations and incrementally repairs the violations until a consistent assignment is achieved [Han and Zukerman, 1996]. An agent in MAGPIE controls its own

variables, and it can also ask other agents in the system to modify themselves. Communication in MAGPIE is limited to agents and their children.

WIP was introduced in E. Andre, W. Finkler, W. Graf, T. Rist, A. Schauder, and W. Wahlster, WIP: The Automatic Synthesis of Multimodal Presentations, Intelligent Multimedia Interfaces, M. T. Maybury (ed.), AAAI Press, California, 1993, pp 75-93.

21

In MAGPIE, an agent is created for each component to be laid out, and a presentation planning agent integrates the components. The agents are dynamically

organized into hierarchical groups, arranged by task decomposition. Each agent in MAGPIE is concerned with the attributes and values of its particular item; for example, the table agent determines the parameters for presenting the table; these parameters include the width and height of the table, the number of columns and rows, the width of the columns and the height of the rows, the headings of the columns, and the content of each cell. The authors state that a constraint satisfaction problem in multimodal presentation planning is a distributed constraint satisfaction problem (DCSP). For example, the

planning agent places constraints on the width and height of a table. This constraint is passed on to the contents of a cell in the table. To develop a solution to the DCSP, each agent maintains its local parameters, as restricted by any existing constraints. Agents cooperate with each other to maintain global consistency of all the constraints. The agents satisfy required constraints before they satisfy preferred constraints. MAGPIE uses heuristics to select presentation styles. These selections are based on a users preferences or on resource restrictions. heuristics are the users age, sex, and literacy level. If the perceiver has no style preference, agents are created for each style. These agents compete for the presentation. Those which violate space restrictions are The variables which affect the

eliminated. A heuristic based on time and space consumption is used to select the final style from the remaining choices. If time permits at the end of the process, agents repair violations made to preferred constraints. For example, consider a table that has accompanying text either above or below the table. MAGPIE would prefer to display this table with the text to the left or right, since our eyes naturally move in that direction.

22

3.3.2 Layout Construction: A Case Study in Algorithm Engineering


The first of these sources is from Aarhus University in Denmark. In a paper from Aarhus University in 1993, Layout Construction: A Case Study in Algorithm Engineering, the authors discuss the design of a system for generating newspaper layout proposals [Franden et al, 1993]. The system input consists of editorial information, which includes articles, their priority, the size of headlines, and pictures; and style information, which is information that is aesthetic as opposed to semantic. Style

information is further broken down into feasibility constraints and quality preferences. The work on this problem breaks newspaper layout into two problems. The first problem is in finding a feasible layout that is optimal or near-optimal, where optimal is defined with respect to a quality measure provided by through the style information. The method through which this project determines quality deserves some exploration. They define editorial input as an element in the set of real numbers. Similarly, a feasible layout proposal is also an element in the set of real numbers, Rm. The style information restricts the feasible layouts to a subset of Rm. The style

information also ranks the feasible layouts according to a quality measured on a linear scale as a real number. A maximum quality layout cannot be found because of

combinatorial explosion, thus it is necessary to make a trade-off between time and quality, which is done by using the highest quality layout found within a specified time limit. The second problem is finding a representation of the style information that both supports its use in the combinatorial optimization and supports its modifications through high level user interaction and automatic inference from a database of examples, which is to say that the second problem is a search for a layout that satisfies the style information and at the same time creates a layout which can be easily modified and is similar to an already-proven successful layout in the systems database of examples. The solution proposed in this paper combines heuristic search, randomization, and neural networks. The first version of the system works by using the bisection strategy, in

23

which a page is recursively bisected until the number of subdivisions on the page is the same as the number of articles to be placed. The abstract algorithmic solution, augmented with randomization and time distribution, does not use specialized layout knowledge. The randomization enables the system to create nondeterministic layouts which are independent of idiosyncrasies of the implementation. Therefore, running the same information through the system can result in distinct layout proposals. The time distribution makes efficient use of a specified search time. This system also proposes the use of neural networks to help design the pages. Neural networks have the advantage of being able to determine aspects of a layout proposal which may be difficult to program directly. In general, holistic aspects of layout quality are hard to program; examples include the balance of items on a page. The neural network has also been proposed to recognize preferred layouts; for example, the net prefers pages with smaller articles placed towards the outer edges of the page. The bisection method is also discussed. The algorithm for bisection explores all possibilities of splitting the page. The number of resulting sections is equal to the number of articles. The authors defined an informal quality function that preferred pages in which small articles are placed at the sides of the page near the bottom corners or near advertisements. Their quality function disliked small articles that were randomly placed on the page. Their system created layouts which were consistent with these points.

3.3.3 Newspaper Layout Aesthetics Judged by Artificial Neural Networks


The second source is also from Aarhus University in Denmark. In his 1996 paper, Newspaper Layout Aesthetics Judged by Artificial Neural Networks, Morten Buhr states that automatic newspaper layout is a complicated task because it involves automatic evaluation of layout aesthetics [Buhr, 1997]. The difficulty in this, says Buhr, is that it does not seem possible to describe the concept of aesthetics by a few simple rules. He investigates the use of artificial neural networks (ANNs) to do this task. 24

Buhrs work stems from the earlier work done at Aarhus University, the product of which he refers to as a layout proposal algorithm (LPA) that acts as a rough designer, requiring only minor changes by a layout artist. Similarly, Avalon is meant to act as a rough designer. Buhr uses ANNs to filter the best layouts from a set of possible layouts. One of the interesting things that Buhr does is to collapse large sections of related items into one item. Advertisements are placed on one continuous block; they are then collapsed into a single ad. Headlines and subheadlines are collapsed into a single headline. Photographs and captions are collapsed to yield a picture. It is interesting that, while Avalon uses similar groupings in its hierarchical structure, Buhr uses them as a way to group items in the quality checking phase. Aesthetics, determined Buhr, are related to placement with respect to size and priority, and distribution of headlines, photographs, and text. He suggests that two ANNs be used, one for judging placement and one for judging distribution. After running his system with some data and teaching the ANNs, Buhr discovers that artificial neural networks are not suited to the task of evaluating layout aesthetics. His experiments showed an incongruency between the outputs of his system and what the desired outputs might be. Some problems could include the fact that the type of font used in headlines is of importance when determining the weight of items and their placement, or that the weight of ads and pictures might depend if they are color or black and white. Buhr suggests that, since the task is more complex than he originally thought it to be, the optimal solution might work with visual input. He remarks that the knowledge gained through his project form a basis for use in further work in automatic newspaper page composition.

3.3.4 Automatic Layout Tool


The final source is from James P. D. Keast, currently a student at Dalhousie University in Halifax, Nova Scotia [Keast, 1997]. In his creation of an Automatic Layout Tool (ALT), Keast thinks of the challenge of newspaper layout in geometric terms. His idea proposes packing rectangles, representing articles, into a larger rectangle, 25

representing the page. Keasts proposed approach is somewhat similar to the work done at Aarhus University. As with the systems developed at Aarhus, ALT attempts to find the optimal layout in the time allotted. The layouts generated by ALT are created randomly, then evaluated. The layout with the best evaluation result at the end of the specified time limit is the final layout proposal. In the same manner as Avalon, Keasts system then generated output describing where the items should be placed on the page. ALT directs output to a World Wide Web browser. Neither ALT nor Avalon, does not consider L-shaped articles. When packing rectangles, ALTs objectives are that no rectangles should overlap, and no whitespace should be left over at the end. ALT places advertisements on the page first, which is consistent with how conventional newspapers are laid out. Currently, Keasts work only supports two types of ads: those that have the same height as each other, and those that have the same width as each other. The ads are then placed along the bottom of the page or along its right hand side, respectively, leaving space for other items. ALT then places photographs. Once advertisements and photographs have been placed, ALT breaks the remaining space into regions into which the articles are placed. It creates the same number of regions as it has articles to place. After the page has been laid out, evaluation functions are used to test its quality. The overall quality of the page is a weighted linear combination of the following functions: Photo placement. If a photograph is related to an article, the relationship between the placement of the photograph and the article to which it is attached is considered. Having the photograph placed to the left or right of the article is the most optimal arrangement.

26

Article placement. Important articles and large articles should be placed towards the top of the page. Less important and smaller articles should be placed towards the bottom of the page.

3.3.5 Summary
Of these projects, only MAGPIE approaches the problem of layout through the use of agents; two use algorithms to determine the layout of items on a page, while the third tried teaching an artificial neural network how to recognize good and poor layouts. The approaches attempted in these works were, for the most part, rather successful. As far as I can tell, using agents to lay out newspaper pages is a unique and unexplored idea.

27

4. Design of the System


The following section describes how the program has been designed to solve the problem of newspaper layout using agents.

4.1 Introduction to Avalon


The program I developed is called AVALON, which stands for Agents Versed in Acceptable Lay Out of Newspapers (I find that, despite being an acronym, typing AVALON in all capital letters is annoying; I will refer to it simply as Avalon). Before I started to write Avalon, it was necessary to consider the problem in depth, and to determine which aspects of newspaper layout I wanted to implement, and which aspects were not crucial to the operation of such a program but could be added later to enhance the programs functionality.

4.2 Limiting the scope of the problem


There are many different items which may be placed on a page: articles, headlines, continuation tags, and so on. A system which could work with all of these different items would be quite extensive and is beyond the scope of this project. We will limit this project to placing articles, advertisements, photographs, and masthead. simulate headlines. Despite not being implemented, items which are part of a larger item the caption on a photograph, for example, or the byline on an article will be discussed briefly because they demonstrate an important aspect about the agent-based structure of this project. It will also

28

4.3 Agents and subagents


There are two types of items: larger items, which includes articles, photographs, and advertisements; and subitems, which include headlines, captions, bylines, and so on. The subitems are a part of a larger item. Subitems do not exist by themselves on a newspaper page; they are always associated with a larger item. Their placement, sizing, and other attributes are determined by the placement and sizing of the larger item. There would be two ways to implement agents which represent these subitems. The first way would be to make these agents equal with the agents which represent larger items. For example, a caption agent and an article agent would act in the same way. They would both respond to commands from a MAIN agent, which is an agent that has a global view of the page and which suggests how other agents should manipulate their items. The agents would communicate with other agents at their own level. A caption agent could negotiate with an advertisement agent, for example. The second way to implement subitem agents would be to make these agents into subagents which would be under the control of their larger agent. For example, a caption subagent would be controlled by a photograph agent. The larger agent would be

responsible for communicating with the MAIN agent. It would also be responsible for communicating with other agents at its level, and for communicating with its subagents. In this way, if a photograph agent is told to shrink, the agent can control the aspects of the actual photograph as well as the caption though communication with its caption subagent. The subagents have no communication with MAIN, and no communication outside of their larger item. A caption agent never gets to negotiate with an advertisement agent or a headline agent. It can only communicate with its larger agent.

29

MAIN

Article1 Headline1 Byline1

Article2 Headline2 Byline2

Masthead1

Photograph1 Caption1

Figure 4.1 Hierarchy of agents in a possible layout. This layout would include two articles, a masthead, and a photograph. This diagram shows which agents are subagents of others: Headline1, for example, is a subagent of Article1. As signified by the dotted lines, the four agents (Article1, Article2, Masthead1, and Photograph1) are created by MAIN but are not subagents of MAIN. Note that this is not a communication diagram.

The advantage to this implementation is that MAIN, which has a global view, does not have to be concerned with such details as headlines and captions. MAIN tells an article or a photograph, Fit yourself in this space, or Reshape yourself, and the article or photograph agent does so (if it can) by changing its own item as well as instructing its subagents to do so. In essence, MAIN tells the larger agent, Change yourself. I dont care how, just use whatever is at your disposal to change yourself to these specifications. By using this black box technique, it is not required that MAIN have the capabilities to directly change parts of the system at such a low level. The problem with the first implementation suggested, with all agents at equal levels, is that MAIN has to be concerned with too many details. This is not good, because we want to optimize MAIN so it has a global view of the page. Its concern is placing items in such a way as to fit the items on a page in the best manner possible. It should leave the details up to the individual agents otherwise, there would be no need for them. There is also no communication among subagents who have different parents; for example, a caption agent would not communicate with a headline agent. However, a caption agent would speak with its photograph agent, which would in turn communicate with an article agent, which would communicate with its headline agent. This ensures 30

that the responsibility for manipulating an item remains with the parent agents domain. Requests must go through the parent agent, which decides what action to take to satisfy a request.

4.4 Abstraction of articles


It is not necessary for the purposes of this project to read in and display actual articles. Instead, we can be content with reading and displaying representations of

articles. We will be concerned with two aspects of the article: the title of the article, so we can see which article is being manipulated, and the total number of characters (called number_of_characters in the function below)2 contained within an article. The number of characters can be used to tell us how many column units large the article is by using this equation: cu = number_ of _characters CPC + ( tracking * 5)

Where CPC is the average number of characters per column, and tracking is based on a zero-centered scale (no tracking = 0; loose tracking = 1; tight tracking = -1). In our implementation, we will leave the value for CPC to the user, but we will insist on a default of 41, which is a realistic value for a column worth of text. Tracking*5 allows the actual tracking to adjust the number of characters per column; thus, according to this, the maximum number of characters per column is 46, and the minimum is 36.

Do not get confused between the total number of characters and the number of characters per column. The total number of characters is a value which represents how many characters the article contains. The number of characters per column is a value which represents how many characters can fit across one column of the newspaper page.

31

4.5 Design of the system


As discussed previously, there will be a MAIN agent as well as an agent for each article to be placed. The MAIN agent has an overall picture of the page, while the individual agents have specialized knowledge about their own articles and how they can manipulate their articles. Domain of MAIN agent

Domain of Agent for Article 1

Article 1 Article 2

Domain of Agent for Article 2


Figure 4.2 Views of the MAIN and article agents. The item agents have a local view. They are concerned with the layout of their item and, although they can communicate with other agents, they are specifically devoted to the item they control. The MAIN agent has a world view of the entire page. MAIN is concerned with the pages overall appearance.

The system starts with a blank page and proceeds to add items to the page. The choreographer of this activity is MAIN, an agent that knows how items should be placed on a page, and that serves as an intermediary in communication between agents. MAIN is essentially a layout manager. MAIN has a world view of the page. It can tell at any moment which agents article is occupying a space. It can determine where there is open space in which an article can fit. It is crucial to have an agent with a world view because some agent has to know if there is no more space on the page, or why a particular layout might not be possible. It can tell, for example, where there are extra spaces, and try to consolidate the spaces to make room for another article.

32

Each of the articles to be placed on the page is assigned an article agent. Article agents know how to manipulate an article to reshape, resize, or move it. They have a local view of their article. This means that the article agents only need to worry about how their article looks and what their individual needs are. This also means that they must go through MAIN when they want to do something with their article, such as finding a location in which to put it. The human user of the system creates a data file which contains article titles and the size of the article, expressed in either column units or number of characters. Upon executing the program, MAIN starts its work. The first thing it does is to read the article data and sort it according to article size, with the largest article is first. Then it assigns an agent to each article. The name given to these agents is A followed by a sequence number; thus, the largest article begins to A1, the second largest to A2, and so on until An. The number of agents is limited to 255, which is more than sufficient for creating a single newspaper page. The least number of agents possible is 1. After the articles have been assigned to agents, MAIN starts its job as layout manager. It instructs A1 to find a suitable location for its article. After A1 tries to find a spot, it responds to MAIN with either an Okay or a Cannot Find Spot message. If a spot has been found, MAIN instructs A1 to place its article in that spot. If a spot cannot be found, MAIN asks A1 to reshape itself and try again; if that doesnt work, MAIN starts talking to other agents who have placed articles on the page to get them to reshape, or to ask them to swap positions with the agent that is having trouble placing its article. You may have noticed that there are two commands which do something very similar: Find Spot and Place. There is an important reason why these two commands remain separate. While it would be possible to consolidate them into one command, by keeping them separate an agent can find a spot that fits its article without actually placing its item on the page. This would be useful if an agent is looking for an ideal spot. A spot may be considered ideal for a number of reasons; perhaps an ideal spot is one that will have no space left over once the article is placed.

33

Another reason to separate these commands is that Place is the opposite of Lift, which is used when it is necessary to temporarily remove an article from the page in order to shuffle the page around and make room for other articles. Finding a spot does not alter the page; placing and lifting does change the page. Since agents have a local view, they dont immediately know about other agents which have placed articles on the page. They know that other articles exist on the page for example, when trying to place its article, A2 might receive a message that a space is filled but they dont know which agents own the articles, or even which articles are on the page.

4.6 Communication
It is necessary for agents to communicate with each other so they can work together to devise a layout for the page. There are a variety of ways in which agents could communicate with each other. We will look at these techniques and determine which would be best suited for this system.

4.6.1 Posting to a bulletin board


One way for agents to communicate with each other is by posting a message to a bulletin board. For example, when an agent needs a certain amount of space that it cannot find, it posts a message to the bulletin board. Other agents read the bulletin board and, if they see a request that they can satisfy, remove the message, satisfy the request, and tell the originator that the request has been satisfied. Posting to a virtual bulletin board is an indirect and passive way for agents to communicate their needs. It is indirect because there is an intermediate system the bulletin board between the agent making a request and the agent who can satisfy the request. It is passive because messages posted to the bulletin board must be read by other agents. A specific agent is not asked to do a task; they must take it upon themselves to find problems on the bulletin board and do something about them if they can.

34

Both the indirectness and passiveness of the bulletin board method make it unsuitable for this application. It requires agents that respond to messages to know everything that they can possibly do; for example, before an agent can respond to any messages, it must know that it can reshape a number of ways, resize itself, move itself, and so on, so that it can respond to a request that might ask for the agent to do these manipulations. Additionally, the bulletin board could easily become saturated with

requests from all of the agents, while none of the requests ever gets fulfilled. In addition, posting to a bulletin board does not allow for conflict resolution, since there is no direct agent-to-agent communication. An additional problem would be the occurrence of circular requests: A1 requests that A2 move right, while A2 requests that A1 move left. Both agents post their requests, but neither is able to satisfy the others request. One way this could be alleviated would be to assign values to the requests which would relate to the importance that the task get done: maybe it would be more important for A2 to move right than it would for A1 to move left. Realizing the importance of moving right, A2 might revoke its request of A1, and comply with A1s request. A problem in using the bulletin board system for this application would be the lack of direct conversation between the agents. In this system, it is important that the agents be able to negotiate quickly and efficiently among each other. Posting to a bulletin board would be analogous to conversing with a friend through written letters: youll both get each others messages, but they take a while to go between you, and they dont allow for immediate feedback.

4.6.2 Direct communication between agents


Another method of dealing communication is for an agent to recognize that there is a conflict, ask MAIN which agents are conflicting with it, and communicate directly with the conflicting agent. Thus, if A2 is trying to place its article but there is no room, A2 would ask MAIN which agent is in its way. Suppose, for example, MAIN responds that A1 is causing the conflict. A2 would then communicate with A1, perhaps asking if A1 can shrink to a single column, or move its location. 35

This is a more active method, since A2 knows what it wants and asks A1 to provide it. A1 can provide a solution through a number of actions for example, if A2 asks A1 to move up, A1 might move its article, or adjust its tracking so it can shrink the article, or reshape the article so it does not occupy as much depth. A1 can also respond that it cannot move its article up. This method is also direct. An agent requesting an action speaks directly with the agent who can satisfy that request. There may be some constraint propagation in cases like this: A1 might not be able to shrink its article, for example, unless A3 shrinks its article as well. So A2s call to A1 is followed by A1s call to A3. Similarly, A3 may have trouble reshaping itself unless another article changes its positioning. A problem with this is that agents can get into a loop. Continuing the example, suppose that A3 asks A4 to reshape itself so A3 can fit according to A1s specifications. It is possible then that A4 can only do so if A1 can move. This creates a call to A3, to A4, back to A1, and so on. To prevent this, communication trails can be added to requests; these trails would show through which agents the request has travelled. A1s first request to A3 might be, move right (trail: A2) while its second request to A3 might be, move right (trail: A2 A1 A3 A4). A1 would look at this command before sending it and notice that it has already asked A3 to do this. Since the command has made a loop back to A1, that agent should be responsible to resolving the conflict. One solution might be, Cannot move right. Another might include removing some articles and shuffling the order in which the agents place their articles.

4.6.3 Communication through an agent hierarchy


There is another way for agents to communicate with each other. This next method is active but indirect. It uses the notion of a M AIN agent that knows everything about the page but does not do the actual manipulations of the items that is left up to other agents with which MAIN communicates. Agents which encounter difficulty in trying to place their articles tell MAIN that there is a conflict. MAIN, as the layout manager, then asks the agent to manipulate its article a little bit. If this does not help, 36

MAIN asks a nearby agent to change its appearance a bit. If this does not help either, MAIN can switch the order in which these two agents place themselves, then go back another agent and ask it to reshape its article. There are some benefits to this approach. First, communication trails are not required. Communication is between MAIN and an agent. Individual agents do not make requests of other agents. It might seem then that the agents are passive, which is true to some extent since the agents rely on MAIN, but the communication between MAIN and the agents is active, since MAIN is communication directly with another agent and awaiting a response. If a solution does not work within a set amount of reconfiguring, MAIN shuffles the order in which agents place their articles and tries again. This is helpful because it gets agents out of any loops that might occur which could not be detected by communication trails (such loops might be composed of alternating commands: Shrink, Cannot shrink; Reshape, Cannot reshape; Shrink, Cannot shrink...). These three methods are illustrated in Figure 4.3. The third method is the one which is implemented in this project. Bulletin Board Main

A1 A1

A2 A1 A2

A2

Figure 4.3 Three methods of communication among agents. A1 and A2 are agents in the system. A) Posting to and reading from a bulletin board. This method is indirect and passive. B) Communication directly with other agents. This method is direct and active. C) Communication to other agents through an intermediary agent. This method is indirect and active, and is the one which is implemented in this project.

Because not all requests can be satisfied, it might be helpful to know why a requests might go unfulfilled. Response codes enable an agent to tell MAIN why it might be impossible to do the requested action; for example, when an agent whose article is

37

1cx7u is asked to reshape itself, it might respond that it cannot, since 1cx7u is the only configuration possible for a 7cu article. Instead of just saying, I cannot, the agent says, I cannot because... and sends a reason along with its response. Knowing this, MAIN can decide if other actions might allow the agent to comply to the request; maybe if MAIN asked the agent to adjust the tracking of its article, the agent could do so, increasing the size of the article to 8cu, and then reshaping it in a 2cx4u shape.

4.6.4 Form of the message


Now that a method of communication has been established, it is important to specify how agents communicate with each other. It is important that all of the agents speak and understand commands in the same way in order for them to understand each other. Ontology is a particular theory of the nature of being or existence [Russel and Norvig, 1995]. It is the kinds of concepts an agent has and how these concepts are structured. Ontology is used to interpret facts; the same situation may have different meanings to different agents. Without corresponding ontologies, two agents may receive the same message but interpret it differently. As an example of noncorresponding ontologies, consider two agents talking about the latest Steven King tome. One agent, perhaps an agent who enjoys fiction, might look at it and think, A frightfully gripping tale! and the other, perhaps an agent versed in ecological conservation, might think, A horrendous waste of trees! There are four types of communication which may be sent between agents: queries, commands, information, and responses. A query is a question which is posed to another agent. An example of a query would be, Can you shrink your article? A command is an explicit request to another agent. An example of a command would be, Shrink your article, or Place your article. Information is data which is returned is response to a question; for example, If you could reshape your article, what size would it be? might be a query for which 2cx4u would be information given in return.

38

A response is return when a command is given: the response to, Shrink your article might be Cannot shrink article or Okay. In the system implemented here, we are primarily concerned with commands and responses. Further work might involve queries and information. When an agent wishes to speak to another agent, it sends a message which is composed of the sender name, receiver name, the message, and any parameters which may be necessary. One example where parameters are necessary is in a swap command. When an agent is told to swap with another, it also need to know with which agent to undertake the swap. This information is passed as a parameter. The current commands which are understood by the system include the following:

Command FindSpot Place Lift MoveUp MoveDown MoveLeft MoveRight Shrink Expand Show

Function Locate a position on the page which can fit the item owned by the agent. Put the item in the spot found by FindSpot. Remove the item from its spot. Move the item up the page. Move the item down the page. Move the item left on the page. Move the item right on the page. Adjust the tracking to make the article smaller. Adjust the tracking to make the article larger. Displays data concerning the item: position, tracking, column units, dimensions, characters per column, title, and whether the article has been placed. Make the article a different shape using the same number of column units. Used to shuffle the order in which articles are placed. Two articles exchange their position 39

Reshape Swap

in MAINs list of agents to place. ShowMatrix Displays the current contents of the newspaper page.

Table 4.1 Commands which may be exchanged among agents.

Many of these commands produce responses which are monitored by MAIN and used to determine its next course of action. The following are responses which may be sent when a command is given to an agent:

40

Response Okay

In Response To Lift

Meaning The operation was successful. A location could not be found to contain the article in its current configuration. The article has not been placed. Usually because there is insufficient room to place it. The article has been placed. The article cannot be shrunk. The tracking applied to the article is as high as possible. The article cannot be expanded. The tracking applied to the article is as low as possible. The article cannot be reshaped. Usually because the number of column units occupied by the article is prime; for example, a 1cx7u article can only be 1cx7u. The article has been swapped as requested.

SpotNotFound FindSpot NotPlaced ConfirmPlace CantShrink CantExpand CantReshape Place Place Shrink Expand Reshape

Swapped

Swap

Table 4.2 Responses which may be exchanged among agents.

4.7 Goal testing


There are two considerations for testing goals: Testing how close we are to a goal, and testing the legality of a final state. Testing how close we are to a goal is a

challenging task in this system. A page could look very good, but upon the addition of a single additional item, the entire page might have to be reworked. Item agents have goals. Their goals are to keep within the knowledge and rules of their item, and to try to keep within the guidelines. It would be the goal of an article agent, for example, to make sure that it is taking up the proper amount of space on a page. MAIN also has goals. Its goals are to keep the overall page layout in line with its knowledge and rules, and to try to do so within its guidelines. It follows that goal satisfaction requires all agents to satisfy their goals. Goal satisfaction is achieved when all of the agents have placed their articles. 41

In [Laasri et al, 1992], the authors identify four stages of multi-agent problem solving in designing complex systems, where designing the system is the top-level goal which must be achieved so that the problem may be solved. The goal is formulated in the stage referred to as problem formation. In the focus-of-attention stage, each agent selects the set of components to design next. The third stage decides which agents will design which components, and is called allocation. Finally, in the achievement stage agents attempt to achieve the goal allocated to them. In this Avalon, the top-level goal is the acceptable design of a newspaper page. The goal is already formulated (the goal being a layout design), so there is no need for a problem formation. The focus-of-attention stage is a little different than described in Laasri et al, because it is MAIN which decides which items (or components) to place next. The equivalent to Laasri et als, allocation stage is the spawning (dynamic creation) of agents to go along with items which are placed. In the achievement stage, agents fit themselves on the page and negotiate their way through conflicts. Sycara [1992] identifies three main tasks that compose negotiation: generation of a proposal, generation of a counterproposal based on feedback from dissenting parties, and communication of justifications and supporting evidence. The negotiation process stops, says Sycara, when all concerned agents accept a proposed design. In this layout system, the proposals generated are equivalent to Can you move down? or Move right one column. There is no generation of a counterproposal, but there can be the rejection or acceptance of a proposal. The proposal is rejected or accepted based on the

capabilities of an agent in a particular situation: if the agent can move right, for example, it will accept the proposal to do so. The rejection of a proposal can be followed by a reason code sent back to the requesting agent. This information may help the requesting agent find a different solution to its conflict. Klein [1991] discusses conflict resolution in cooperative design systems, under which category this layout system would follow. He gives examples of two agents who want different things, and who reach a consensus. In one of his examples, Jan and Mark are cooking dinner. Jan wants to add some hot spices to the dinner, but Mark doesnt

42

want the spices. They decide to let Jan add the spices to her own portion of the meal. This type of conflict resolution requires knowledge; in this example, knowledge that the meal would be broken down into portions after it has been cooked, and that spices can be added to a portion. Klein reveals the following strategies which this system would use:
If two plans for achieving two different agents goals conflict, then find an alternate way of achieving one goal that does not conflict with the other agents plan for achieving its goal. [Klein 1992]

In a similar way, layout management agents might be able to come to a resolution between two situations in which neither agent loses. An example of this might be, I cant move down any more, but if I shrink my tracking and you shrink your tracking, we can both fit here. This type of resolution requires agents to know how other agents can act, which they can do by posing queries. While Avalon does not currently implement this functionality, its use in future versions of the program could help to create layouts which are designed with more agentto-agent cooperation. This, in turn, could lead to better layouts, since the agents involved in the resolution have more specific knowledge about their items then the MAIN agent does. They can therefore make more informed decisions about their items placement.

4.8 An example
The following example demonstrates what Avalon can do. We start with three articles which are to be placed on a page.
Given: A page, split into two columns, Three articles, each about 1/3 of the total space on the page, but one of which is larger than the other two, Rules for determining acceptable configurations, Criteria for deciding what operations to apply to the articles to reach that goal, Build: A configuration which satisfies the goal.

Preliminaries

43

The articles will be referred to as Article1, Article2, and Article3; the agents which own these articles as A1, A2, and A3, respectively. In each step in the following example, the text within the brackets denotes from which agent communication is originating, and for which agent the communication is intended. When other agents respond to communications, they do so in a way which reflects their ability to do the task requested of them. In the actual implementation, the Place command is preceded by a FindSpot command. The difference in these two commands is subtle; FindSpot requests that an agent locate a spot in which its article can fit, while Place actually commands the agent to drop its article at that location. For now, considering Place and FindSpot as one

command is sufficient, although later we will see why there is a need for these two commands to be separate.

Steps the system would take: 1. [MAIN] Arrange the articles according to size
Since we want to place the largest article towards the top of the page, it would make sense to organize the articles according to size (from largest to smallest), and then start placing articles in order. This is not a message, but it is an important step.

2. [MAIN to A1] Place Article1 [A1 to MAIN] Article1 placed 3. [MAIN to A2] Place Article2 [A2 to MAIN] Article2 placed
When an article is placed, it is shaped in the most favorable configuration possible. For example, an 8 column-unit article can be 1cx8u and 2cx4u. Each of these configurations is given a value representing its quality; in this example, 2cx4u might be better than 1cx2u. Thus, 2cx4u would be chosen out of the possible configurations, since it is the most favored.

44

Up to this point, the articles have been placed without conflict. However, upon trying to place Article3, there will be a conflict because the article is too large to fit in the space remaining once the first two articles have been placed. See Figure 4.4.

3. [MAIN to A3] Place Article3 [A3 to MAIN] Cannot place


MAINs attempt at placing the third article was unsuccessful, so something must be done to reorganize the page to make the article fit.

Article2
Placed

Article1
Placed Available space

Article3
Where would it go?

Figure 4.4 The current configuration for the example session. Note that, while there is enough total space on the page for Article3, there is not enough space for the article. Some rearranging must be done to fit the third article.

4. [MAIN to A3] Shrink Article3 [A3 to MAIN] Okay 5. [MAIN to A3] Place Article3 [A3 to MAIN] Cannot place
In this case, MAIN would ask A3 to try to shrink its article by adjusting its tracking. If after a couple of tries the article still cannot fit in the space allotted, MAIN will ask A2 to reshape its article (A2 is asked because it is the agent which most recently placed its article). Reshaping is the selection of another configuration; to follow the previous example, if an 8 column-unit article was shaped at 2cx4u but that shape restricted the positioning of other articles, the article might be reshaped to 1cx8u.

45

6. [MAIN to A2] Reshape Article2 [A2 to MAIN] Cannot reshape


Article2 cannot be reshaped and still fit on the page. For the time being, it must stay in its current shape.

7. [MAIN to A3] Place Article3 [A3 to MAIN] Cannot place


If reshaping the previous article does not work, MAIN will swap A2 and A3s position in its list, in the process lifting A2s article from the page, and then backtrack to A1. MAIN will ask A1 to reshape itself, and once it does, it will now ask A3 to place its article. If that is successful (as we will assume it is), MAIN will ask A2 to place its article.

8. [MAIN to A2] Lift Article2 [A2 to MAIN] Article2 lifted 9. [MAIN to A3] Swap list position with A2 [A3 to MAIN] Swapped 10. [MAIN to A1] Reshape Article1 [A1 to MAIN] Done 11. [MAIN to A3] Place Article3 [A3 to MAIN] Article3 placed 12. [MAIN to A2] Place Article2 [A2 to MAIN] Article2 placed

46

Article1
Placed

Article 3 Placed Article2


Placed Figure 4.5 The final configuration for the example session. Note that Article1 has been reshaped to allow the other articles to fit.

4.9 Searching the space of possible configurations


There are many possible configurations for a page given a set of items. When Avalon searches the space of possible configurations, it does so by starting with the configurations that have a high degree of preference; these configurations have the most favored attributes; for example, large articles are placed towards the top of the page, and the articles are shaped as close to squares as possible. As restrictions are placed on the positioning and shaping of articles, the configurations on the path to the final configuration contain less preferences. Articles might be shaped in a way that is not their most optimal shape, for example. The final configuration is a result obtained by starting with the space containing the most preferred configurations for one item in the set, and constraining the space as more items are placed.

4.10 Parts of the program


The program is composed of a number of parts, each of which has a specific function that contributes to the layout of a page. The parts are as follows: Send, which allows agents to communicate with each other,

47

Arranging the items, which uses Quicksort to arrange the items according to their size, Best spot finder, which locates a place on the page in which the an item will fit, Reshape, which can change the shape of an article, Shrinking, expanding, and automatic tracking, which deal with the number of characters per column in an article, Main (the layout manager), swapping, and backtracking, which are used to tell agents when to place their items.

4.10.1 Send
One of the more important underlying functions of this system is the Send function, which allows agents to communicate with each other. If an agent wishes to communicate with another agent, it sends its message to the other agent through the Send command. The Send command awakens the destination agent and gives it the message. That agent is then responsible for doing what is asked of it or responding with a reason why it cannot accomplish the requested task.

4.10.2 Arranging articles using Quicksort


When the articles are read from the input file, they are sorted according to the number of characters each article contains. This is done to satisfy rules which state that larger articles should go on the top of the page. The sorting is done with a Quicksort algorithm.

4.10.3 Best spot finder (FindSpot)


When an article is to be placed, a call is made to a function called FindSpot, which finds the best spot for the article in its current size. When FindSpot sees a location on the page that the article would fit in, it sends a message to the agent owning that article with the coordinates of the space. If FindSpot fails, a message is sent to Main, which then decides if it wants to resize the article in question or do other manipulation of the articles, such as swapping their order.

48

4.10.4 Reshaper
The Reshaper function is called when an article cannot be fit in its current dimensions. Articles can be laid out differently depending on how many column-units they contain. If an article contains a total of twelve column units, for example, it may be resized as one column by twelve units, two columns by six units, or three columns by four units, or four columns by three units. Reshaper has two subfunctions. One of these is the Reshaper Preferences

subfunction. While an article can be reshaped, some of these shapes are very appealing, whereas others are not visually pleasing at all. A two column by six unit article may look very nice, but a four column by three unit article is too wide and too short. If the program can prevent this shape from being chosen, it should. This is an example of a heuristic. Each arrangement is passed through a function which determines its quality. The function is designed such that long but short articles are avoided, and square shaped articles are preferred. When the Reshaper function is determining what shape to make the article, it takes these values into consideration. Reshaper also considers what the articles recent shapes. This is important

because if, for example, a shape did not work two times ago, the chance of it working again (so soon) is unlikely. Three previous shapes are kept in memory, and the memory acts like a queue. If an article has less reshaping possibilities than memory spaces (i.e., an article can only be one shape but three shapes can be stored in memory), then the previously used shape must be used again. Otherwise, Reshaper will try shapes that do not exist in memory.

4.10.5 Shrinking and expanding, and automatic tracking


Tracking is the spacing between letters. The tracking of an article may be

adjusted slightly to make the article a little smaller or a little larger. Such an adjustment might make it possible to squeeze items enough so they fit well, or expand them so they fill up what little space might be left over at the end. 49

Automatic tracking enables an agent to request a tracking value that would make the article fit a particular area. For example, if an article is 2cx5u and its agent wants to make the article 2cx6u, it can determine what tracking value would make the necessary change in area.

4.10.6 MAIN, the Layout Manager; swapping and backtracking


The MAIN agent controls how articles are laid out on a page. Its first function is to display a layout advisory to the user. This advisory is a statement representing the possibility that an acceptable layout may arise from the articles entered into the system. The advisory is arrived at by determining the total number of column units required of all of the articles and comparing it to the total number of column units available on the page. Table 4.3 shows the messages that may be displayed in this advisory.

Condition x -10% of total

Layout Advisory message There will be a large amount of empty space at the end of this process.

-10% < x -5% -5% < x +5% +5% < x +10% x > +10%

There may be empty space at the end of this process. There should be just enough material for a full page layout. There may be too much for a one-page layout. This layout cannot be done on a single page.

Table 4.3 Layout advisory messages. These messages are produced by MAIN before it begins to lay out a page. They serve as a notice to the user. In the Condition column, x is the total number of column units in all of the articles, ads, and photos which are to be placed. The percentages represent the deviation from the total number of column units on the page.

MAIN has a list of agents, which has been arranged in order of the size of the article that each agent owns. MAIN starts asking agents with the largest items to place their items first; this is followed by increasingly smaller items.

50

Often, there is not a problem placing an article in its most favored shape on the page. When a problem does arise, MAIN takes responsibility for it. MAINs first response is to ask the agent which is having trouble to reshape its article. If this does not help, it will try to shrink or expand the article by asking the agent to adjust its tracking. If this does not work either, MAIN takes the previously placed article off the page and swaps the order of the problematic agent and the one whose article MAIN just lifted from the page. MAIN then tries to place these articles again. If it fails this time, MAIN goes back to the article previous to the one it lifted and asks it to reshape and resize, and then continues down the list. MAIN makes the determination if a layout appears to be impossible. According to MAIN, a layout is not possible if after a certain number of manipulations all of the articles have not been laid out on the page. The maximum number of manipulations is a function of the number of articles that have been entered. This method is used so that MAIN does not continually search for an acceptable layout when one may not be possible. Layouts which are possible are usually solved well in advance of the maximum number of manipulations allowable. An exhaustive or systematic search for a solution might be an option to make sure that all possible layouts for a page have been considered, but implementing this functionality would go against the agent-based paradigm of this approach. Agents should be familiar with how to manipulate their items; if, by working together, the agents cannot design an acceptable layout proposal in a certain amount of time, the layout is considered impossible. There might be a solution, but the agents were unable to find it.

51

5. Implementation
5.1 Data file specifications
Information about the page and its items is given to Avalon through the use of text files. These files contain such data as the size of an article, the size of the page, and the existence of headlines. The following is a discussion on the format of these files.

5.1.1 Avalon 1.0 item file


Avalon 1.0 did not require much in terms of input, since the page attributes were constants, advertisements and photographs were not supported, and headlines did not exist. The input file for Avalon 1.0 is a text file with alternating lines of article titles and number of characters in the article. Thus, the following file was sufficient information for Avalon 1.0: Man falls from bicycle 1029 Fire burns old warehouse 2091 Halloween Ball this Friday 600

Improvements made to Avalon 2.0 required more descriptive files which much more information. The file specification for Avalon 2.0 is discussed in the following sections.

5.1.2 Introduction to Avalon 2.0 files


The page settings file and item input file are both text files. The first line of each file should be AVALON VERSION=2 The text before the equals sign is the tag which tells what the following value represents. There is no space between the tag, the equals sign, and the value.

52

This line may be followed by descriptions of the data file. While there are currently no strict specifications for the next few lines, future versions of Avalon may use the tags listed here. FILENAME=filename DESCRIPTION=what this file is used for: which newspaper, which issue date, etc. After these introductory lines, it is necessary to enter a separator line, which consists of a series of dashes (any number of dashes equal to or greater than three). At this point, the contents of the two files diverge.

5.1.3 Page settings file


The page settings file is not necessary; if it does not exist, the default values for the following tags will be used. If a tag is not specified in the file, the default value for that tag will be used as well. The page settings file uses the following tags: COL How wide the page is, in columns. UNIT How long the page is, in units. EQUIV Default = 5 The width of a column, expressed in units. This value is used when determining shape preferences for articles that may be expressed in a variety of shapes. CPC The average number of characters per column HEADLINE Default = 0 Whether to automatically add headlines to articles. 0 is off, 1 is on. HEADLINEDEPTH The depth (vertical length) of a headline, in terms of units. Default = 2 Default = 41 Default = 32 Default = 4

HEADLINECPC Default = 14 The number of characters per column in a headline. This is usually significantly less than the number of characters per columns because the typeface used in headlines is larger than the typeface used in articles.

53

5.1.4 Item input file


The item input file is the file which contains all of the item information. A separator line is required at the end of each item entry. The item input file uses the following tags: TITLE Required The name of the item. For articles, the title also serves as the headline. The title is useful when trying to follow the action of the articles agent in the program. TYPE Required The type of item this is; possible types include ARTICLE, ADVERTISEMENT, PHOTOGRAPH, or MASTHEAD. Future versions of Avalon will extend the number of types available. NUMCHARS Required if COL and UNIT are not used Number of characters contained in the item. The size, in terms of column-units, can be computed from this value. This tag is not required if COL and UNIT are used. TRACK The simulated tracking between letters in the item. COL Required if NUMCHARS not used and UNIT used Number of columns that the item occupies. If this is expressed, UNIT must also be specified. If COL and UNIT are used, NUMCHARS is not required. UNIT Required if NUMCHARS not used and COL used Number of units that the item occupies. If this is expressed, COL must also be specified. If COL and UNIT are used, NUMCHARS is not required. PERM States the permanence of the item. 0 is not permanent, 1 is permanent. X1 The top, left column occupied by a permanent item. Y1 The top, left unit occupied by a permanent item. Required if PERM used Required if PERM used

54

5.1.5 End of the files


At the end of each file, it is necessary to place and end-of-file marker, which is identical to a separator line, except it is composed of asterisks instead of dashes. Make sure that, in the item file, the line previous to the asterisk line is a separator line.

5.1.6 Sample files


The following is an example of a page settings file. Note that attributes such as EQUIV and HEADLINECPC are not specified. These attributes will be assigned default values when Avalon executes. AVALON VERSION 2.0 FILENAME: SET0000.DAT COL=4 UNIT=26 CPC=41 HEADLINE=1 HEADLINEDEPTH=1 *****

The following file is a sample item information file. AVALON VERSION=2 FILENAME=EX0000.DAT DESCRIPTION=sample layout data TITLE=Media circus surrounds conspiracy TYPE=article NUMCHARS=1800 TITLE=Annual rock-a-thon entertains many TYPE=article COL=2 UNIT=3 TITLE=Liberation Front TYPE=advertisement COL=3 UNIT=4 TITLE=Jobfair TYPE=advertisement COL=2 55

UNIT=7 PERM=1 X1=3 Y1=20

5.2 Accessory programs


In order for the layout simulator to be thoroughly tested, it was necessary to create some additional programs to test its ability. These two programs are the Random Article Generator, a program for producing test articles, and the Display Program, which graphically displays the resulting page.

5.2.1 Random Article Generator (RAG)


The purpose of the Random Article Generator (RAG) program is to create a series of articles of random size and send them to the layout program to see what output is generated. Two parameters are passed to RAG. The first parameter is a seed for the random number generator. By entering this seed, a randomly created set of articles can be recreated, since the random numbers would have been generated from the same seed. The seed is also used as an identification number for data files; thus, Data File 6 would have been created using a random seed of 6. The second parameter passed to RAG tells the program which data set to use. A data set contains variables which RAG uses to determine how many articles to create and what the maximum and minimum sizes of the articles should be. The following values are defined in a data set: Total number of column units of all of the articles, Smallest article size, in column units, Largest article size, in column units, Least number of articles, 56

Most number of articles. Each data set contains different values for these variables. This allows the

program to generate articles which may compose an easy layout or an impossible one. For example, if the total number of column units to distribute to the articles is lower than the number of total column units on the page, the layout will be easy, since all of the articles should fit in the page. However, if the number is larger, a lot of tightening and shuffling may be needed to create a layout. If the number is too much larger, it will be impossible to place all of the articles on the page. RAG assigns each article it creates a randomly generated headline. The headline is composed of a combination of nouns, verbs, adjectives, and adverbs3. The headlines and article sizes are then written to a data file, just as the user would do if he or she were entering articles. This data file is read by the main program. Currently, RAG only creates output in the version 1.0 style, although the output it creates can be used with version 2.0.

5.2.2 Display program (Proof)


The display program, named Proof, graphically displays a layout generated by the system. In newspaper terminology, a proof is a sheet which is printed and edited to ensure that a newspaper page has printed as expected. Figure 4.4 shows a sample layout generated by Proof.

Because the headlines are random, they dont always make sense, but a lot of them do, and some of them are pretty funny (two of my favorites: Firefighter abruptly makes pizza and Supermarket now sells animals).

57

Figure 5.6 Sample output from Proof. The shaded areas represent the locations of articles, which are described in the legend to the right. The article headlines were randomly generated by RAG (which is why not all of the headlines make sense).

While Proof is sufficient in displaying layouts graphically, it is more useful for the layout artist to have the data describing the page layout which Avalon outputs. The reason for this is that Avalons output data contains the exact coordinates where items should be placed, whereas Proof simply displays the result. Probably the best way to handle this discrepancy in the future would be to extend Proof so it not only showed the layout of the items, but the coordinates as well.

5.3 Decision on programming language


It was decided to write the program in C. The program was written using Borland C/C++ version 3.0 on an IBM-compatible PC under MS-DOS. Originally, the program was to be written in Lisp. However, a number of issues arose concerning writing the program in Lisp, such as the proper use of Lisp environments, which I felt were trivial, and I wanted to put more effort into the system as opposed to the semantics of my implementation language. I was more familiar with C, so I decided to use C since I would not take the time required to learn the language better. Although I would have enjoyed exploring the problem through a Lisp program, I figured 58

it would

be a better idea to use a language with which I was more familiar and

comfortable.

59

6. Testing and Evaluation


6.1 Test cases
Test cases were generated by both myself and by RAG. The test cases I generated had the advantage of being intelligently fiendish as opposed to RAGs random data, but both were handled well by the system. To start with, I generated some simple test cases. The first test case was to see if the system could handle a single article, which it did well. The next test case involved four articles of equal size, each of which occupied one quarter of the total space on the page. Due to shaping preferences, the preferred shape of each article happened to be a quarter of the page, so each of the articles fit with no conflicts. Some of the more complex test cases that I developed involved increasing the total number of column units which was dispersed to all of the articles. This meant that the total number of column units contained within the articles is greater than the number of column units available on the page. Some of these cases were able to be laid out. The tracking on some of the articles was adjusted so the article could shrink. The program could not lay out most of these cases, however. Upon reviewing the script created by the program, it appeared that the articles could not be sufficiently shrunk to allow all of them to fit on the page. This is an acceptable answer, since articles have a limit to how much their tracking can be adjusted. If the program could not lay out a set of articles, does that mean that the articles could not be laid out at all? I tried to do some of the sample cases that the program had trouble with, but I as well found it difficult to lay out the page with the articles given. I was unsuccessful in most of these attempts. One layout which I could do easily but the program had difficulty with was the following: There were five articles. They could be sized as 4cx11u, 2cx10u, 2cx10u, 1cx19u, and 1cx19u. The total number of column units is less then 4cx32u (the size of the page). The program approached this by placing the largest article at the top of the 60

page. It then placed the two 2cx10u articles next to each other underneath the 4cx11u. When it tried to place the 1cx19u articles, it could not do so immediately, so MAIN tried reshaping them. 1cx19u is prime, so it cannot be reshaped; MAIN got them to expand, and the article resized to 4cx6u. The article was placed, but then MAIN ran into difficulty when trying to place the second 1cx19u article. There was no room left for this article, no matter what shape it was made, and no matter how much it was shrunk. MAIN removed the previously placed article and swapped their order. It then tried placing what was the second 1cx19u article, but it ran into the same problems. Because one of these articles was continually placed legally, but the second was not, MAIN kept swapping them. MAIN never tried to lift the previously placed articles. I was able to create this layout easily, without resizing any of the articles. I placed the large article on the top of the page, and the two 1cx19u articles next to each other under the large article. One of the 2cx10u articles went under the large article, and the other 2cx10u article fit under that. What did I do differently than the program? I was able to look at the articles available to me and instantly see how they might click together. Following good style, I placed the largest article at the top, as did the program. But then I saw how I could fit the articles together. It appeared than if I placed the 2cx10u articles on top of each other, I would essentially have a 2cx20u block, which, when placed next to two 1cx19u blocks, would create a roughly 4cx20u block, and would create a good layout. The program followed its rules and, according to the rules, it did what it could. This means two things: perhaps the rules could be improved, and if there was a way to implement intuition the program would be even better. Since the former option is more realistic, it deserves some thought. What changes could be made to the program to allow it to effectively lay out the set of articles that I could do so simply? One option might be to change the process of placing articles in order of size and instead place them randomly. Perhaps the best of both methods could be implemented: the program can try to lay out the articles according

61

to size, but if this fails, it can be allowed to place them in whatever random order it can determine. One of the issues about implementing this type of functionality is that some layouts may simply be impossible. Perhaps after a number of tries with random order, the system could then give up, stating that the layout does not appear to be possible. RAG created some rather interesting test cases, including some which neither the program nor I could create layouts for. The number of articles generated did not seem to affect the ability of the program to lay out a page; the program worked just as well with a large number of articles (around fifteen) as it did with a small number of articles (around five), although an actual page with fifteen articles looks very unappealing.

6.2 Adherence to layout rules and guidelines


Avalon was written to follow certain rules and guidelines, which were followed. In fact, when a layout was deemed impossible to do by MAIN, this decision was determined only after the correct rules and guidelines were applied. In many cases, I had difficulty in designing layouts that Avalon said were impossible; some of them I could not do, either. I was also able to see that Avalon followed layout rules well when I tested it against layouts which already existed. These experiments were done by finding a

newspaper page which already been laid out, and entering the data into Avalon. In some cases, such as those discussed in section 5.5, Avalons layouts were the same as the ones on the newspaper pages.

6.3 Quality of output


The output produced by the program was generally of good quality. The largest contributing factor to this is the reshaping preferences; most of the articles were able to maintain their preferred shape. 62

Some of the layouts had random spaces in the middle of the page. These spaces are artifacts from how the articles were placed. Figure 5.1 shows two sample layouts which contain spaces inside the article. There is nothing that can be done with these spaces in the current system because the program has not been told how to deal with them. The quality of the layouts generated by this program can be greatly enhanced with an additional function that would look at a layout at the end, find spaces such as these, and try to do something about them. Removing spaces would become another function of the system. In general, items can always be moved around to prevent spaces among items. It is possible that a layout which removes spaces looks really bad, however. One way for a page to look bad would be to contain articles that are not shaped in their most preferred shapes.

Figure 6.1 Spaces with sample layouts. These two examples show layouts in which spaces have been left among the articles. The layouts to the right of these two examples shows a layout with the same articles that puts the spaces towards the outsides or eliminates the spaces. Note that in the second example some articles had to be reshaped.

The bottom line is that the layouts produced are of acceptable quality according to the rules and guidelines that the system uses to design the layouts. The quality could be better, and this would necessitate additional agents whose function would be to check over the final page, or a page in progress, for unattractive arrangements.

63

6.4 Evaluation form on the World Wide Web


To see what other people think about the layouts created by this program, I wrote a series of Web pages which poses some questions to participants, and asks them to select the most aesthetically pleasing layout from a group, or to comment on a layout. The page may be seen in Appendix B at the end of this report, and the results from the page may be seen in Appendix C.

6.4.1 Contents of the evaluation pages


The pages are pitched towards two types of people: those who are familiar with the principles of layout, and those who are average people who would know a good layout when they see one. The first page is an introduction to the project which should be suitable for both types of people. On the second page, each group of people is asked what they look for in a good layout. The next page contains the actual evaluation. First, just for polling purposes, participants are asked if they think a human or a program can create a better layout. The participant is also asked for his or her familiarity with newspaper layouts. There are four values which the participant may select, ranging from A newspaper? Whats that? to I am a Layout Master. Then, there are four multiple choice questions. Each question contains four

layouts. The participants are never told which layouts were created by a human or by the program. Each multiple choice question contains three layouts generated by me and one generated by the program. The participant is asked to select which layout he or she likes the best. The participant is then asked which layout he or she thinks the program created. Then, the participant is asked what he or she did and did not like about the layouts. The next three questions are short answer opinion questions. The participant is shown a layout (again, not told if it is human or program generated, but all of them happen to be program generated) and asked what he or she likes and dislikes about each of them. In hind sight, I should have asked if the participant thought the layout shown 64

was created by a human or by the program. While it was specifically stated that the viewer will not know which of the layouts were designed by the program or the human, I think the general impression was that the short answer questions presented programdesigned layouts. Finally, the participant is asked on what general criteria he or she based his or her decision on which layouts were generated by the program. The purpose of this page is threefold: 1. To find out what layouts people found visually and aesthetically appealing, 2. To find out how manually created layouts compared to layouts the program designed, 3. To determine the success of Avalons designs.

6.4.2 Responses to Web page


I have not received a lot of response from the Web page only eight responses, despite notifying various newspaper staffs about the site and posting the site on the comp.ai newsgroup. However, the eight responses I did receive give a relatively good idea of what people expected to see in a newspaper layout, as well as why some of the layouts that the program generated were unacceptable. In a few cases, this was because the number of and size of the articles supplied to Avalon was simply ridiculous and made for a bizarre layout; but I did that on purpose, to test the viewers reactions.

6.4.3 Analysis of Web responses


The data indicates that Avalons output was indistinguishable from human generated output. Specifically, out of twenty responses to the four-choice multiple choice questions in which viewers were supposed to pick which layout they thought Avalon created, only four were correct. Avalons layout proposals were good enough to defy detection by newspaper layout experts.

65

In the four multiple choice questions, the Avalon layout proposal was preferred over others in only one question (Design #2). Avalons layout in Design #3 was as preferred as one other layout (see Appendix C). However, the reasons why viewers preferred some layouts over others were not always what was being tested; for example, one viewer stated that the blank space ought to be largest on the bottom, but I had not programmed any handling of blank space into Avalon. The viewers comments would be beneficial in creating a new version of the software.

6.5 First attempt at laying out pages of a real newspaper


On March 23, 1997, I had the opportunity to use Avalon on pages of the March 25 issue of Newspeak, the student newspaper of Worcester Polytechnic Institute. Avalon laid out three pages, the results of which may be found in Appendix D of this report. The first thing I realized was that I did not allow Avalon to accept user-specified page dimensions, even though the program works fine with different page sizes. The number of columns and units are currently declared as constants in the program; a simple modification can allow the program to accept a data file or user input to find out how large the page is. The reason this caught my attention was because the Newspeak page is 26 picos high, and Avalon uses pages that are 32 units high. I proceeded, however, and figured that if any of the articles happened to be placed lower than the 26th unit, I would deal with it when the situation arose. Fortunately, the articles all fit above the 26th unit on the page, except for one article which ended on the 27th unit. In no specific order (since Avalon places the articles in order of size anyway), I entered the headlines and the number of characters into a data file. Once this was done, I executed Avalon with the data files name4 as a parameter. Within seconds, Avalon created a layout, and wrote the data to an output file.

The values passed to RAG, Avalon, and Proof are numbers which indicate a particular data file; for example, RAG 1002 would create a data file named EX1002.DAT, and AVALON 1002 would execute Avalon with the file, EX1002.DAT. Avalon would create DISP1002.DAT when the layout has been designed. Proof would then be executed as PROOF 1002, which would display the data contained in DISP1002.DAT.

66

I preferred to use the actual data file as opposed to the graphic representation when using Avalons suggestions, since the data file contains actual coordinates, which correspond to positions on the page. In this way, I could be sure that I was laying out the page as Avalon suggested.

6.5.1 The first page


I was amazed at how well the first layout came out. The articles fit in exactly the same way Avalon said they would; for example, the topmost article, FIPSE focuses on alternatives to drinking, drugs, was supposed to be placed starting at (1c,1u) and ending at (4c,11u), a space into which it fit into with little effort on my part. I had to adjust the tracking in one paragraph to make the entire article one line shorter5, which was a remarkably little amount of tweaking. Realize that at this point, Avalon just works with articles, not photographs or articles or headlines. This fact shocked me at first; I was surprised that I forgot make provisions for headlines. If I had told the system that I was working with a 26 unit high page, and I gave it these articles, it would have laid the system out well, but space for the headlines would not have been allotted. The layout that Avalon designed for this page contained one article which ended at the 27th unit; by the time headlines were added to the actual page, this article ended even further down the page. Eventually, I decided to remove the article from the page, since there really wasnt any room for it. If I could have told Avalon to create a page with less vertical units and with headlines, the program might have determined that this article could not fit on the page. Another situation that Avalon was not prepared to deal with was user requests. Some articles on the first page were news articles, while some were arts and entertainment (A&E) articles. When laying out the paper, we want to keep similar articles together. That way, we can put a header bar over the similar articles; for

Depending on where the end of a line falls in relation to the width of a column, adjusting the tracking just a little bit has the effect of shrinking or expanding an article by an entire line. Whether or not this will work for an article must be done on a case-by-case basis, since different articles, even if they have the same number of characters, have different appearances because of the way words and sentences happen to split.

67

example, the news articles have a bar over them which says, NEWS. Since Avalon does not take user requests into account, it did not differentiate between News and A&E articles. The layout had to be tweaked to support this. After looking at what other articles that had to be placed, I realized that there were a lot more A&E articles than I had originally thought. In laying out the newspaper, we try to keep similar articles on the same page, so I decided to move the two remaining A&E articles from Page 5. In their place, I put in two news articles which were almost the same size as the two A&E articles we moved. I edited the data file and ran it through Avalon to get its version of the layout. Its end result was used for the final layout of the page, with a little tweaking to make the articles flush with the bottom of the page. There was a little space left over; in this space, I placed a box which declared that Avalon laid out this page.

6.5.2 The second page


It was now time for Avalons second page. This was page 6, the arts and

entertainment page in the March 23th issue. There were four articles to place on this page, which I again measured and then used a simple calculation to determine how many characters the articles should have. Avalon does not handle photographs or advertisements; however, it was necessary to place an ad on this page. To do this, we had to take Avalons layout and do some tweaking to it. The large article, Glee Club visits London, is in the location determined by Avalon. The Gaming weekend entertains many article was supposed to be one column wide and thirteen units deep, but to make the ad fit we had to make this article two columns wide by six units deep (using a little layout magic to turn a total of 13 units into 12 units). Actually, the two column version of this article worked better. It allowed the headline to be long enough to get the point of the article across; a one-column article would have had a narrow and deep headline, which isnt very attractive. The shape we picked for this article had a higher preference value than the shape that Avalon suggested; but keep in mind that originally, the article was 13 units deep, and since 13 is not evenly 68

divisible by 2, Avalon kept the article in its 1cx13u shape. Only by adjusting the tracking could we make the article flow evenly into two columns. This illustrates one spot where Avalon could use some additional knowledge maybe, Try to make articles into a more favored shape, even if it requires additional manipulation. The Coffee Hour article was suggested by Avalon to be one column wide and eleven units deep, but this had to be manipulated as well to make room for the advertisement we had to place on this page. The article was made two columns wide by five units deep. The remaining article, Oberlin a cappella group performs at WPI, was kept in the shape that Avalon suggested, but moved down the page, since it was smaller than the Coffee Hour article which now appears above it.

6.5.3 The third page


The last page Avalon laid out on this day was page 10, which contained news stories. Originally, there were two articles slated for this page: Winners of Academic Honesty essay contest announced and Comet Hale-Bopp a sight to see. This page was supposed to contain some ads, and I also wanted to write an article about Avalon laying out these pages. I thought I would wait and see how much space had to be filled before writing the article. Avalon laid out this page as expected: the large article was placed on the top, followed by the smaller article. I saw how much room I had for my article, so I wrote my article with the intention of filling up that space. There was also some other space which was not contiguous with the space left for my article; this could be used for announcements, or maybe a small ad. When I was done, I had an article that was too large for the space available, and I could not think of anything to cut from the article. So much for staying within the space I had allotted. I had to move a lot of items on the page to get my article to fit; I finally came out with a layout that I was happy with, but then I realized that Avalons suggestions were all changed, except for placing the large article at the top. I wanted to 69

see how Avalon laid out this page, now that I had written my article and it had a definite size. I was rather amazed to see that the page it produced was the exact same as the page I laid out on my own! With a little minor tweaking, I stretched the space possessed by my article so I could fit a little cartoon graphic representing Avalon. I used some of the remaining space to further advertise my MQP Web pages, as well as to place the little box declaring that Avalon laid out this page. There was still a little space left; it was used for an ad.

6.5.4 Analysis
Avalon did an excellent job suggesting layouts for the pages it was assigned. The resulting layouts required little tweaking, and any left over space was usable for ads. It took a little time for me to measure each of the articles; if I had the correct number of characters per column entered into the program I probably could have done this a bit faster, although the process still required some data collection on my part. I also had to actually lay out the pages in Adobe Pagemaker once I got a design from Avalon. It took time to measure and then lay out the articles, and then we made some changes to the layouts once the articles were on the page. The time it took to do all of this was comparable to the amount of time it would take to do the work without Avalon, but the program is not as full-featured as it could be, and since this was the programs first attempt at a real world scenario we gave it some extra looking-over. Avalon made most of the decisions; it almost seemed as if I was the tool, gathering data and laying out the page according to Avalons specifications, and Avalon was the layout artist! (Which isnt too far from the truth!) The proof sheets (the sample pages on which we check for inconsistencies in layout) of the whole paper were checked by our Layout Manager, Eric Wilhelm, our CoEditor-in-Chief, Ed Cameron, and myself. Pages 5, 6, and 10 required no adjustments, which is to say there were no layout errors on the page. Since the layouts were entered by me and tweaked once they were drawn in Pagemaker, this does not mean that Avalon

70

produced flawless layouts. However, the underlying structure in the layout and the designs that Avalon produced successfully passed our scrutinizing. Will Avalon be used in the future for Newspeak layout? Quite possibly, if for no other reason that explore the limits of the program. And, it never hurts to get a second opinion; one of the reasons I ran page 10 through Avalon after I had totally changed it was to see what the program would come up with. The program and its results were well received. Eric stated that Avalons layouts were practically flawless. It came up with some stuff I wouldnt have thought of. Ed was impressed when he first saw the pages that Avalon laid out. I had Avalon lay out only three pages because other pages were too specialized. Such pages included the front page, which has a variety of requirements, such as the positioning of a photograph as well as indices and a masthead; the back page, which has special sections such as the police log and the Whats Happening feature; and so on. One page in particular that I was going to have Avalon do contained a 4cx7 inch advertisement; since this ad took up almost half of the page, it didnt make sense for Avalon to lay out the page since it was easily done by a person. Only one article went on this page, and it had a photograph associated with it.

6.5.5 Creation of Avalon 2.0


After using the program on pages of a real newspaper, I was able to determine what its strengths and weaknesses were. I fixed a lot of the shortcomings I saw in Avalon version 1.0, which is discussed in depth in Appendix E. Version 2.0 allows pages of a user-specified size; it allows for the placement of advertisements and photographs; it lets the user specify items which should be permanently located at a particular location; it implements basic headlines; and it extends the input that may be given to the program.

6.5.6 Laying out the previous pages with Avalon 2.0


After creating Avalon 2.0, I ran the program with the same items that I used in the pages I originally used Avalon to lay out. I had to update the data files to support the

71

larger array of items which can now be used by Avalon.

Specifically, I added

advertisements to see how the program dealt with them, compared to the layout I created. Page 5 came out the same as the first time it was designed. The only addition to this page was a small ad. Because of its size, it was placed last. The rest of the articles were placed the same as they were the first time, and the ad fit in the space which was left over. Page 6, the page which required the most amount of tweaking to Avalons design, came out the same as I laid it out, which was not very surprising: I decided to permanently place the two ads, because I already knew what their best position would be6. This restriction limited the locations where the articles could be placed, and since Avalon places items in order of size, the articles fit into the spaces provided. Page 10 also appeared the same as the first time it was laid out. The design which Avalon produced the first time was what I used to lay out the page; the ads I added to page 10s data file fit into the space left over on the bottom right of the page.

6.5.7 Second attempt at laying out pages of a real newspaper


Equipped with Avalon version 2.0, I went back to the Newspeak office the following Sunday and worked on more page layouts. These pages incorporated

advertisements as well as articles. I worked on two pages of the April 1, 1997 issue. Avalons layout for page 9 required some revision, because a large amount of space was left over at the end; this space could be used for an ad. Because of the number and size of ads we had to place in the April 1 issue, it was difficult to tell which ads to have Avalon place without having a visual representation of the page. I had to make one article somewhat L-shaped (something Avalon cannot do) to allow an ad to fit. For the most part, however, the final page used Avalons design as a basis. This reinforces the notion that Avalons purpose is to create rough layouts that may require some tinkering

The best placement for an ad depends on whether the page is a left-hand page or a right-hand page. Generally, ads go to the outside of the page, and towards the bottom.

72

by the layout artist. At this stage in exploring automatic newspaper layout, this is quite acceptable. Page 10 also required a little tweaking, mostly because one of the articles was placed in a rectangle which left one unit between the article and the permanent ad on the bottom of the page. To remedy this, I made the article L-shaped, and placed an ad in the resulting space. The rest of the final page is exactly how Avalon said it should be.

73

7. Analysis and Conclusion


7.1 Strengths and weaknesses of Avalon
The program works well, although it is unable, for example, to prevent the existence of spaces among articles, and it does not have the functionality to tweak the end result to fill little spaces that may be left over but are not large enough to require a rearrangement of the page.

7.1.1 Weakness in functionality


Many of the weaknesses of the program can be fixed through additional work; for example, the program does not allow articles to be shaped other than rectangles, but irregularly shaped articles are very common in newspapers and can help eliminate spaces between articles. Also, a layout with irregular shapes makes the layout less blocky and more appealing. Additional functionality would strengthen the program, increase its ability to create exceptionally layouts, and enable its results to be applied to more real world situations.

7.1.2 Weakness in architecture


To program Avalon, I used a computer that computes in serial. It would have been much more interesting to assign each agent to its own processor; these processors could run in parallel, so instead of having only one agent active at a time, the whole system could be active. The interactions between these agents would have presented some interesting behaviors; I am sure there would have been a lot more conflicting requests. It would have been interesting and challenging to see the conflicts that would have arisen from a parallel architecture.

7.1.3 Strength in system design


Despite not being parallel, I think the use of agents in newspaper layout was extremely successful. The resulting layouts were, for the most part, exceedingly well

74

designed, requiring only minor tweaking in most cases. It appears that having agents which communicate with each other is an effective way of addressing this problem.

7.1.4 Ambivalence towards system design


I wonder what would have been different if MAIN was set up differently. Right now, MAIN has a list of things it does to items if they cannot find a spot. What would be different if this list of things to do were more dependent on the items characteristics? This leads to the question, should MAIN know the specifics of individual agents? How would agents express their uniqueness to MAIN? I express this as ambivalence because I am quite comfortable with the way in which I designed MAIN, but I wonder what could have been if MAIN were designed differently.

7.2 Additional work


There are many parts of this program which could be developed further. The project in its current state effectively demonstrates newspaper layout using agents. However, there is additional functionality which, if implemented, would make the system even more complete.

7.2.1 Working with a greater set of items


Avalon version 1.0 worked only with articles, version 2.0 works with articles, advertisements, photographs, mastheads, and headlines. Further implementations could easily extend this to include captions, photo credits, bylines, and continuation tags. Implementing these items would require implementing the corresponding communication methodologies discussed earlier. Subagents captions, bylines, and so forth would be able to communicate only with their parent photograph or article. In fact, version 2.0s current implementation of headlines is dumb since the headlines are not controlled by an agent, as they should be.

75

7.2.2 Expanded communication abilities and a more intelligent MAIN agent


As discussed earlier, there are four types of communications which may be exchanged among agents: queries, commands, information, and responses. In the current system, only commands and responses are used. Queries and information could also be implemented. These abilities would enable MAIN to have a better idea of what could be done with the articles on the page. This means that a more intelligent MAIN might be able to make better layouts. If MAIN has a lot of appropriate information, and it knows what to do with that information, it is possible that MAIN can create more intelligent and better layouts.

7.2.3 Bidding for space among agents


Instead of MAIN determining which spaces should go to which articles, individual agents may be able to look at the page and state that they have a preference for a particular location. Agents may place bids for their most favored locations, and bids would be analyzed by MAIN. The benefit of bidding is that some agents might be able to place their articles in more acceptable locations. Bidding would help agents fulfill their guidelines, which are facts that should be true but do not have to be in order for the layout to be acceptable. In his Contract Net Protocol, Smith [1988] discusses agents which announce an availability in the system, along with requirements of the agents who would be able to fill the vacancy. Agents receive these messages and, if they have the requirements stated, form a bid that they return to the agent who announced the availability. The winner of the bid gets to fill the vacancy. In the layout system, MAIN can recognize the availability of space, for example, There are five empty column units in the lower left of the page. MAIN would also have to list requirements of the agents who can fill this space: You must have a small article, preferably one that can occupy five column units. Agents would receive this message and compose a bid. The agent whose article best fits the requirements would be awarded the bid.

76

Agents can also go through bargaining. Bussmann and Muller [1992] discuss bargaining agents which communicate and resolve issues in such a way as to make a deal with other agents. In a similar way, layout management agents can engage in bargaining to better fill the page. For example, an agent might say to another who is occupying the lower left of a page, I am a smaller agent, I would rather have that space. I can give you this larger-sized article space on the right side of the page in exchange.

7.2.4 Enhanced representation of the page


The current program displays the resulting layout in the form of shaded rectangles. With some extra work, it would be possible for the program to read in actual articles and photographs, and compose a page which would be immediately publishable as an actual newspaper page. This could also be done by generating a data file that would be compatible with publishing software, such as PageMaker.

7.2.5 Ability to read actual articles


Instead of reading representation of article which are composed of titles and number of characters per column, the system could read actual articles and determine the information it needs. This would be especially useful if the representation of the page is to be realistic.

7.2.6 Extending the possibility of article shapes


Currently, articles are manipulated as blocks. However, it is possible for articles to occupy a non-rectangular area depending on what other obstacles (such as photographs or advertisements) that may be on the page. The program can be further expanded to allow articles that are not shaped simply as blocks. Implementing this feature would also increase the number of cases for which this program would work; for example, there may be an arrangement that is impossible to arrange without creating an irregularly shaped article, as per Figure 7.1.

77

Article Advertisement

Figure 7.1 A benefit of irregularly shaped articles. Suppose a page must be created with an article and an advertisement as shown above. If the articles can only be shaped as rectangles, there is no room on the page for the article and the advertisement, as shown by the layout on the left. If, however, irregularly shaped articles may be created, then the article could be manipulated in such a way as to allow enough room for the advertisement.

7.2.7 More special requests for item positioning


In version 1.0, it was not possible to specify a permanent location for an item. This was overcome in version 2.0, through the use of item specific data, information which pertained to the placement or structure of a particular item. The functionality of permanence is one case in which item specific data is used. There could be additional information which the user may wish to provide; for example, suppose the user wanted an article to be a definite shape This article has to be 2cx4u without the article being located at a permanent location (at this point, permanence applies to location and shape). Or, suppose the user does not want an item to be located in a particular spot: Place this advertisement anywhere except the top of the page. This additional information could be given through extended use of item specific data.

78

7.2.8 Recognizing article groups


While laying out the first page of Newspeak, I noticed that the articles Avalon had to place were a mix of news and entertainment stories. It would be appropriate for stories with similar types to be together; this placement makes it easier for readers to find articles of interest. If articles could be declared as belonging to different families news, sports, entertainment, and so on the placement of these stories can reflect that. This is another case in which item specific data could be used.

7.2.9 Support for multiple pages


This program lays out a single newspaper page. It would be possible to extend this to a number of pages that would be connected. This means that articles could be continued to another page, allowing for a wide array of possible manipulations to make to a page to create a series of pages on which articles fit better than they would without being continued on another page. Something to be careful about when splitting an article between two pages is what the article looks like on each page. Suppose, for example, that an article has been continued from the front page to page 3. On page 3, if the first word in the continued article is the last word of a paragraph, it looks weird because it seems all by itself. Preferably, the lone word should somehow be removed, whether through tightening the tracking on its sentence, or continuing its entire sentence to page 3. Similar care must be used for articles which have subheadings. A subheading should have some text beneath it. The program should be careful about leaving a subheading on one page and moving the first sentence under the subheading to another page.

7.2.10 Attaching items to other items


When placing articles and photographs, it is important that some items are attached for example, a photograph showing participants in a food drive should be placed next to the article about the food drive. This attachment is currently not supported in Avalon, although it is an important part of layout. 79

It appears that, with this agent-based hierarchy, it would be necessary for a group of attached items to be assigned to its own agent. This superagent would be

responsible for the attached material as a whole, distributing commands to its component article and photograph agents. I suggest this because the attached items would have to be manipulated as a group. Just as a headline and a byline are part of an article, the article and its photograph are part of a larger item. While an attachment exists between items, the individual item agents the article agent, the photograph agent would not communicate with MAIN, but with their superagent. communicate with MAIN. In discussing their system, MAGPIE, Han and Zukerman [1996] discuss agents that have inter-agent constraints. These constraints allow multiple layout objects to be thought of as one unit. The superagent would then

7.2.11 Touch-up functions


Once the page has been laid out to the best of the programs ability, touch-up functions could examine the page and make minor tweaks to make the page more presentable. Examples of tweaking might include making an article a little longer to fill in a small gap, or sliding a photograph over to center it among the columns. This functionality requires a set of procedures which can look at a page and determine which touch-up functions to apply to a given page. These procedures would have to be familiar with what makes a final page more presentable, and what makes it unacceptable.

7.3 Possible uses


Obviously, Avalon would be a valuable tool for layout staffs of any newspaper. This tool could become just as widely used as page publishing software is currently. The tool would be especially valuable if its results could be sent directly to the page publishing software; the layout artist could immediately use and manipulate Avalons

80

layout to complete the design of a page. The tool would be of great assistance in a newspaper production room which may be understaffed or otherwise overworked. Another use for Avalon would be in automatic, personalized newspaper generation. There are currently quite a few services on the World Wide Web that can be used to request personalized newspapers, carrying only those articles that the user is interested in reading. At this point, these services simply list the newspaper articles on a Web page. Avalon could be used to lay those articles in a graphical image which could be displayed on a Web page; the image would look like a newspaper page. This would further the analogy between paper newspapers and electronic newspapers.

7.4 My MQP experience


This experience was a very educational one. First and foremost, I learned a lot about agents, an exciting and relatively new field of research that promises to be an important part of future work in a variety of domains. My hands-on experience with agents has given me a lot of knowledge and ideas that I will definitely be able to use again. Determining the evaluation criteria for the layouts was an interesting and challenging task. It was sometimes difficult to take knowledge about what I and other people do on a newspaper layout and come up with a representation of this knowledge that the agents could use. I think that doing this helped me realize why I apply certain rules when I do layout; in the past, I applied some rules without much thinking, but now I realize some of the intricacies behind it. As an overall experience, this MQP was quite rewarding. I was able to take a task I enjoy, analyze it deeply, and implement a system using new technology that creates acceptable layouts. The result is an excellent software tool which I am proud to have created.

81

7.5 Conclusion
Using agents to design a newspaper layout seems to be a worthwhile venture. The various capabilities of agents, such as communication and conflict resolution, seem well suited for the task of designing a layout. As stated in this report, Avalon creates

acceptable layouts; with some additional functionality, the layouts could be even more complete. I am glad to have had the opportunity to get additional time in which to work on the project; the changes and additions I made to Avalon to bring it to version 2.0 were significant, and they created even more realistic page layouts.

82

Appendix A. Evaluation Form Placed on the Web


The following pages are print outs from my pages on the World Wide Web which invited guests to comment on the layouts that Avalon produced and to select which layouts they liked the best. These pages may be found at http://www.wpi.edu/~dkoelle/Agent/Voting.

The next pages consist of the following: Introduction page (2 pages) A question for those who are inexperienced in layout A question for those who do newspaper layout The main questionnaire (6 pages) Answers to the multiple choice questions

83

Appendix B. Data Gathered From Evaluation Form


The following data was collected from the evaluation form I placed on the World Wide Web at http://www.wpi.edu/~dkoelle/Agent/Voting. collected may be found in section 6.4 of this report. A discussion of the data

91

Note: Discrepancies in the numbers result when viewers did not answer all of the questions. In particular, while eight people responded to the survey in some way, only five viewers answered the multiple choice and short answer questions. As someone who reads newspapers, what types of page layouts appeal to you or turn you off? What makes a newspaper page look good? (Answered by 2 people) Articles should not span the center of the page; this makes it difficult to read a paper in tight places, such as on a plane or a train. Id rather the layout of each story be square or wide rather than tall. This doesnt mean one wide column, but a group of standard columns. As someone who is familiar with newspaper layout, what are some of the things that you try to do or look for in a newspaper layout? (Answered by 6 people) Due to the number of responses, I have categorized them for easier analysis. Numbers in parentheses denote how many people suggested a particular guideline. Advertisements Place ads towards the bottom of a page. (3) Never trap text beneath an ad. Try not to have a full page of advertisements (unless, of course, its full page ad). (2) Placement Place more important / larger articles closer to the top of the paper. (2) Balance the placement of articles and ads in a paper. Page Appearance Keep things well-varied; avoid a situation where every article spans the width of the page, or where the page is split vertically. Have uniform margins (all articles go to the margins). Keep it active pictures in the middle of a storys text, use quote boxes and lines. Have items flow from a single corner, preferably the upper left; that way the reader is drawn to the rest of the page. Dont fill a single page with several small articles; things tend to get lost. Instead, have a large article or ad, then fill the rest of the page with smaller articles. Keep articles and text towards the outside of pages and keep advertisements and photos towards the center of pages. The placement of stories is highly dependent on content. Try not to have a full page of just text (except where appropriate for a particular newspaper, such as opinion/editorial pages). Spreading articles Dont stretch an article over the whole page. Try to spread large articles across four columns. Breaking articles 92

If an article needs to be broken up and continued on another page, make sure to note which page it is continued on/continued from. Dont break articles over several pages. If there is a subheading within an article, make sure that there is at least a couple of lines of text underneath it at the bottom of columns. Whitespace Dont crowd the page with too many articles. Avoid large amounts of whitespace within and between articles. Leave some whitespace to give the eye a chance to rest. Pictures Use pictures to break up the articles. Keep photos with related articles (if they exist). If there is more than one photo or piece of artwork on a page, try to choose one photo to make a little bigger than the rest; dont have all the stuff be the same size. Headlines Never have two headlines next to each other unless they are significantly different sizes, or separated by a line running down the page between them [because the two headlines will appear to be the same headline]. Make the point size of headlines start larger on the top of the page, and get increasingly smaller the further down the page you go. Miscellaneous Dont use all of column one and very little of column two. Adjust the tracking of written articles as a method of fine tuning a story so it will fit in a given area.

What is your familiarity with newspaper layout? The layout of a page does not concern me .................................................... 0 I occasionally read newspapers ..................................................................... 0 I am familiar with some principles of newspaper layout............................... 2 I am a Layout MasterTM and can lay out a page in my sleep ......................... 3 In general, which do you think would create a better page layout? The program .................................................................................................. 0 A person ........................................................................................................ 4 Designs 1 - 5. Each mark represents one vote; this is done so the most popular answers can be seen at a glance. Marks in the Preference column represent the layout which the viewer liked the best. Marks in the Avalon column represent the layout which the viewer thinks was created by the program. The bold-faced letter represents the layout

93

which was designed by Avalon. Ideally, the most popular selection in the Preference column should be Avalons design. Design 1. Preference Avalon A / /// B / / C / D // Comments: Blank space ought to be largest on the bottom D contains empty space which can be easily filled later D looks good overall D is the only option with left over whitespace for ad placement Preference Avalon A / B / C /// / D // // Comments: Tough to choose which one the program designed (chose D) No usable space left over on any of the options Avalon A / B // / C / // D // / Comments: no comments offered Preference Avalon A / / B / C // // D // / Comments: Tough to decide which layout the program generated (chose D) I picked the one that was least odd (chose B) Did not like any of the designs All of the designs are too busy Page is too cluttered; people wont read it Preference

Design 2.

Design 3.

Design 4.

Designs 5 - 7. These designs asked for the viewers comments. Design 5. Comments: Like article on the top left. Dislike article on the bottom right. Dislike central space. Looks fine. 94

Big article should stretch across top of page. Should not be split in half. Single article on the right should be eliminated. The top article of the right column should be two columns wide. Design 6. Comments: Looks good. Try to stay away from single column stories, especially next to each other. Too blocky; would look better if the top articles fourth column was longer than the other three columns. This is nicer; the tiering effect is pretty nice. The bottom of the page is cluttered. Design 7. Comments: Its okay; too bad you cant make one story into an L-shape, with another story nested inside. Dont like two same-sized articles next to each other. Good, except remaining whitespace is not usable. Good distribution of articles, placement is good. On what criteria did you decide which layouts the program generated? I suppose that the program put larger stories near the top, and probably avoided a page where all articles are placed similarly. I figured that the program generated the most basic ones the ones that seemed to have the least amount of creativity put into them. Tried to think how Id implement such a thing and what it would do Of the four layouts, three were similar while one was different. I figured that the one that was different was the one that the program generated.

95

Appendix C. Pages of Newspeak Laid Out by Avalon


The following are copies of three pages from the March 25, 1997 issue of Newspeak, the student newspaper of Worcester Polytechnic Institute. The layouts on these pages were designed by Avalon. Of course, it was necessary for the layout staff to manually place the articles on the page, since Avalon does not interact with publishing software. The articles were placed according to how Avalon decided to place them; in some cases, tweaking was necessary to fix up the end result. On page 10, there is an article entitled, MQP uses agents to design layouts, which is an article I wrote about this project and its role in laying out the attached pages. A discussion of Avalons performance in laying out these pages may be found in section 5.5 of this report.

The next pages consist of the following: First attempt Page 5, version 1 Page 5, version 2 Page 6 Page 10 Data files and session from Page 5, version 1 Data files and session from Page 5, version 2 Data files and session from Page 6 Data files and session from Page 10 Second attempt Page 9 Page 10 Data files and session from Page 9 Data files and session from Page 10

96

Appendix D. Additions and changes in Version 2.0


After using the program to lay out pages of WPI Newspeak on March 25, 1997, and with the benefit of some additional time in which to work on Avalon, I made the following changes to the program. See also section 6.5, in which I discuss Avalons first attempt at laying out real newspaper pages. It might be beneficial to read section 6.5 first to understand the need for the changes discussed here. These changes have been made in Avalon version 2.0.

Changeable page attributes


In version 1.0, the number of columns and number of units of a page were defined as constants. I immediately found this to be a problem when I tried laying out pages of Newspeak because I had to find an analogy between the measurements used on the page and the constant number of units defined in the program. The page itself was 26 picos. I would have liked to have a page which was also 26 units, since it would be a direct analogy between the real page and Avalons page. Fortunately, there was only one minor instance in which the Newspeak articles that Avalon laid out went below the 26th unit, so I was still able to use the layouts that the program suggested. Additionally, the program should let users define their own page attributes, such as number of columns. In some newspapers, the front page and opinion/editorial pages have a different number of columns than other pages. Also, different newspapers have different numbers of columns; if I wanted to use Avalon to lay out a paper besides Newspeak, I would want to change the number of columns and units on the page.

124

I also found that the number of characters per column which I used as a constant was incorrect; I had used a value of 70, but the actual number of characters per column in Newspeak is an average of 417. Users can now create a settings file, which contains attributes such as number of columns, number of units, and characters per column. attributes which are discussed below. If the user does not specify a settings file, Avalon will default to 4 columns, 32 units, and 41 characters per column. For more information on the structure of the settings file, see the Users Manual in Appendix A of this report. One of the problems associated with this functionality is that the original table I created for shape preferences could no longer be used. I needed a new, flexible way to determine what shapes were preferred over others. It also contains some other

Flexible shape preferences


In version 1.0, I created a 4x32 table in which each possible shape was given a preference value. The Reshape function used these values to determine which shapes were more aesthetically pleasing; square shapes were preferred most of all, followed by long shapes, followed by wide shapes. Now that version 2.0 supports variable page sizes, it was necessary to devise a way for Reshape to tell which shapes were more preferred. While figuring out a way to do this, it became obvious that there had to be some correlation between columns and units. Columns can be different sizes in different newspapers; a 2cx6u article might look good in one newspaper but atrocious in another. This led to the creation of an equivalency value, which is specified in the settings file, or Avalon uses a default value. The equivalency value states approximately how many units wide a column is. With this value, the program can tell whether shapes are

In October 1996, Newspeak changed its appearance. The value of 70 characters per column was correct in the old Newspeak layout, but the new newspaper uses 41 characters per column. The changes in newspaper attributes were not reflected in this project until version 2.0. Also, the old style was 32 picos deep.

125

square, long, or wide. For example, a 2cx2u shape is only square if the width of a column is equal to a unit; if a column is twice as wide as a unit is high, a 2cx2u shape translates into a long shape which is four units wide by two units high. Now that there is a way to tell what shape certain configurations may be, the program can create a function that decides which configurations are preferred over others. This formula is a function of a shapes area as well as its perimeter. It should also prefer square shapes over long shapes, which are both preferred over wide shapes. The formula which computes preference is Preference[C,U] = 4C + U ECU

where C is the number of columns occupied by the shape, U is the number of units occupied by the shape, E is the equivalency value, the width of a column in terms of units. This function provides a value which in itself is meaningless but in relation to the values of other configurations points out which configuration is most preferred (lower values are more preferred). For example, consider a 24 column-unit article. Configured as 24 columns by 1 unit, the preference function (using an equivalency value of 5)8 returns 0.8083. Reshaping the article to 12 columns by 2 units gives 0.4167, compared to a 2 column by 12 unit shape, which returns 0.1667. Shaping the article 4 columns by 3 units gives 0.3167. The most preferred shape out of these is 2cx12u; the least preferred is 24cx1u (which is only possible, of course, if the page were 24 columns wide). In order to prefer long shapes over wide shapes, the number of columns in the dividend is multiplied by four. When wide configurations are computed, the dividend is made greater because of the constant, which results in a higher value for the preference function.

An equivalency value of 5 means that each column is five units wide.

126

Support for advertisements and photographs


Another shortcoming of version 1.0 is that it dealt strictly with articles. Version 2.0 lays out articles, advertisements, and photographs. Both advertisements and photographs are images that cannot be resized but can be moved around the page9. This support for images also means that a masthead can be included in a layout. Advertisements and photographs were quite easy to implement; the only difference between them and articles is that articles can be resized and reshaped. In some cases, advertisements should be positioned at a stationary location on the page. This need gave rise to the next change in version 2.0.

Support for permanence


Some articles or advertisements, and in particular mastheads, should be located at a definite spot. Version 2.0 now allows this. In order to support permanence, it was necessary to extend the item input file specification, discussed below. To be located at a permanent location, an item must have permanence specified, as well as a location at which to be positioned. If an item already occupies the spot required by a permanent item, the items are eventually swapped and the permanent one is placed first. When MAIN wants to place an item, it does not consider whether the item is permanent or not. The fact that an item is permanent should be visible only to the items agent, not to MAIN; it is a fact with which MAIN should not occupy itself. The placement of permanent items could be done in a variety of ways. For example, permanent items could be placed before other items. This would prevent permanent items from conflicting with larger items which usually get placed first.

Photographs should be proportionally resizable, but that functionality is not available in Avalon version 2.0.

127

If two items are both permanent and require the same location or overlapping locations, MAIN eventually decided that the layout cannot be completed.

Extending item input


One of the things about version 1.0 that I did not like too much was that each article had to be entered with a number of characters. Suppose, however, that the user knew the space an article took up, but not the number of characters it contains? The user could do a simple calculation to approximate the number of characters in the article. But this step should not be necessary. Additionally, now that advertisements and photographs can be entered, they must be entered by the number of column units they occupy. Permanence also requires additional input for a particular item. To support all of this, I changed the way in which input could be accepted. In version 1.0, articles were entered in a text file which contained the headline of the article on one line and the number of characters in the article on the next line. This method of input is still allowed for backwards compatibility. Version 2.0 defines its own specification for a text file which contains item data. This specification is discussed in depth in the Users Manual in Appendix A. The new method allows the user to enter the item title (which is its headline in the case of articles), the type of item (such as article, advertisement, photograph, or masthead; other types, such as captions, are allowable but not yet implemented), number of characters or the number of column units an item occupies, and whether the item is to be permanent and, if so, at what location it should be placed, the tracking of the text.

Implementation of headlines
One of the most surprising things I discovered when running Avalon for the first time in the real world was that it did not save space for article headlines. Version 2.0 now gives the user the option of having headlines automatically placed. The use of headlines, the number of units deep a headline is, and the number of characters per column in a headline are all defined in the settings file. The title of an article in the item input file is used as the articles headline. The number of characters in 128

the title of an article is significant, since it is used to determine how many lines the headline occupies. The number of characters per column in a headline is different than the number of characters per column in an article, since a different text size is used in headlines. If the number of characters in the headline fit across the top of an article, spanning all of the columns which the article occupies, the headline occupies one line. If the headline is too long for the number of columns available, it continues to another line. If it does not occupy half of this new line, the line is ignored; essentially, Avalon has said, This headline does not take up sufficient space in the second line to look good; you can probably change the headline so it fits on one line. If the headline goes over half of the second line, however, Avalon now considers the headline occupying two lines (with the hope that the user will make the headline a little more appealing by adding to it to make it go to the end of the line). The number of lines a headline occupies is multiplied by the number of units a line of headline text occupies. This is then added to the height of the article. When Avalon shows how it placed the articles, the user cannot see a difference between an article and its headline; however, upon laying out the page, the user will instantly realize how much space is occupied by the headline he or she has created. The user will also realize that the article occupies the remaining space. Currently, headlines are essentially dumb headlines. They were added to make version 2.0 a little more realistic, but they are not fully implemented. According to the design of this system, headlines should have a headline agent, which would be a subagent of the an article agent. The headline agent should have control over all aspects of the headline, which should include changing the tracking on a headline, and maybe changing the font size of the headline. The headline agent might also be responsible for cutting text from a headline to make it occupy less lines, which might enable more items to be placed on a page. The possibilities for headline manipulation are beyond what version 2.0 can do at this point.

129

References
M. E. Balazs, D. C. Brown, P. Bastien, and C. E. Wills, How to Present Designs, Proc. IFIP WG5.2 Conference on Knowledge Integrated CAD, KIC-2, CMU, 1996. D.C. Brown, Some Thoughts on Configuration Processes, Proc. AAAI 1996 Fall Symposium Workshop on Configuration, MIT, Cambridge, Massachusetts, USA, November 9-11, 1996. M. Buhr. Newspaper Layout Aesthetics Judged by Artificial Neural Networks. Aarhus University, Denmark. May 1996. S. Bussman and J. Miller. Bargaining Agents. IJCAI, 1993. S. Bussmann and J. Muller. A Negotiation Framework for Cooperating Agents. Proceedings of the Special Interest Group on Cooperating Knowledge Based Systems, 1992. K. S. Decker, E. H. Durfee, and Victor R. Lesser. Evaluating research in cooperative distributed problem solving. In L. Gasser and M. N. Huhns, editors, Distributed Artificial Intelligence, Vol. II, pages 485519. Pitman Publishing Ltd., 1989. G. Frandsen, J. Palsberg, E. Schmidt, S. Sjogaard. Layout Construction: A Case Study in Algorithm Engineering. Computer Science Department, Aarhus University, Denmark. DAIM PB-450. August 1993. S. Franklin and A. Graesser, Is it an Agent, or just a Program?: A Taxonomy for Autonomous Agents, Proceedings of the Third International Workshop on Agent Theories, Architectures, and Languages, Springer-Verlag, 1996. http://www.msci.memphis.edu/~franklin/AgentProg.html Y. Han and I. Zukerman. Constraint Propagation in a Cooperative Approach for Multimodal Presentation Planning. European Conference on Artificial Intelligence, 1996, pp 256-260. J. P. D. Keast. Dynamic Layout of News: Automatic Layout Tool (ALT), An Algorithm and Implementation. Work in progress. Department of Mathematics, Statistics, and Computing Science, Dalhousie University, Halifax, Nova Scotia. March 1997. http://www.ug.cs.dal.ca/~jkeast/honours/paper/alt/alt.html M. Klein. Supporting Conflict Resolution in Cooperative Design Systems. Transactions on Systems, Man, and Cybernetics, Vol. 21, No. 6, 1991. IEEE

130

B. Lasri, H. Lasri, S. Lander, and V. Lesser, A Generic Model for Intelligent Negotiating Agents, International Journal on Intelligent Cooperative Information Systems, Vol. 1, No. 2, 1992, pp 291-317. T. A. Moehlman, Victor R. Lesser, and Brandon L. Buteau. Decentralized Negotiation: An Approach to the Distributed Planning Problem. Group Decision and Negotation, 2, 1992, pp 161-191 J. S. Rosenschein and G. Zlotkin. Rules of Encounter: Designing Conventions for Automated Negotiation among Computers, The MIT Press, Cambridge, 1994, pp 1-27. S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach, Prentice-Hall, Inc., New Jersey, 1995, pp 31-52. R. G. Smith. The Contract Net Protocol: High-Level Communication and Control in a Distributed Problem Solver, Readings in Distributed Artificial Intelligence, Morgan Kaufmann Publishers, Inc., 1988. R. Smith and R. Davis. Frameworks for Cooperating in Distributed Problem Solving. In Readings in Distributed Artificial Intelligence, B. Spatz, ed. 1988. K. P. Sycara. Cooperative Negotiation in Concurrent Engineering Design, Cooperative Engineering Design, Springer Verlag Publications, 1990. . Negotiation planning: An AI approach, European Journal of Operational Research, 1992. . Persuasive Argumentation in Negotiation, Theory and Decision, Vol. 28, No. 3, May 1990, pp 203-242. http://www-cgi.cs.cmu.edu/afs/cs/user/katia/www/persuader.html I.S. Torsun, Foundations of Intelligent Knowledge-Based Systems, Chapter 12. Academic Press, 1995. R. Wesson, F. Hayes-Roth, J. Burge, C. Stasz, C. Sunshine. Network Structures for Distributed Situation Assessment. In Readings in Distributed Artificial Intelligence, B. Spatz, ed. 1988. M. Wooldridge and N. R. Jennings. Intelligent Agents: Theory and Practice. Knowledge Engineering Review, Vol. 10, No. 2. Cambridge Univeristy Press, 1995. http://www.doc.mmu.ac.uk/STAFF/mike/ker95/ker95-html.html

131

You might also like