Professional Documents
Culture Documents
10 1 1 85 7006
10 1 1 85 7006
MAY 1, 1997
APPROVED:
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.
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.
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.
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.
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].
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
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
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).
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
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
18
implemented effectively, we must first define what the problem is, and come up with solutions to solve it.
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.
19
20
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.
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
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.
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.
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
28
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
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.
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
Article 1 Article 2
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.
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.
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.
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.
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.
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
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.
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
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
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.
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.
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.
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.
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.
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.
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
54
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
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.
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.
it would
be a better idea to use a language with which I was more familiar and
comfortable.
59
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.
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.
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
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.
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.
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.
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.
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.
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.
71
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.
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
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.
75
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.
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.
78
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
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.
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
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
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
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
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
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.
126
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.
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