Project 2: Managing Software Development Spring 2010 Karl Lieberherr ================================================================== In project 1 you familiarized yourself with SCG and you have written a simple HSR avatar. You thought about how to build an SCG arena where multiple games in different scientific domains take place. I no longer like the term "arena" after talking to Ahmed Abdelmeged. It reminds me too much of bull fights etc. Instead, I will use the term "Scientific Community Game Courts", abbreviated SCG Courts. Game courts is a standard name for a place where multiple games happen. We want to get help in building our SCG Courts: We already have a court for one sport only: the constraint satisfaction (CSP) court. But it is a complete court: it has an "office" where players from all over the world can register. Tournaments take place, usually starting at midnight and they last for a few hours. The results look like this: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/competitions/past_competitions/11_02/tournament_1/final_results_tournament_2009_11_03_05_43_17.html And the games generate a lot of data such as: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/competitions/past_competitions/11_02/tournament_1/ In this project 2 we approach the development of SCG Game Courts from two directions: bottom up and top down. In the top down direction, we decompose SCG Game Courts into subsystems (see chapters 6 and 7 on system design and chapter 8 and 9 on object design). In the bottom up direction we develop a complete avatar that will participate in a tournament in CSP Court collaborating and competing with the avatars of your peers. The CSP Court has value for us, because we want to reuse it by ripping out the CSP dependent part and make it generic. This is easier said than done but it is a typical situation: A company has developed a successful product and now they want to build a product family of similar products and gain larger market share. CSP Court is a legacy system that is written in DemeterF. We use mostly the structural features of DemeterF: it is very good at generating parsers and printers from annotated UML class diagrams. This will be very important for generating parsers for the communication languages for claims, instances and solutions in SCG Courts. I will explain how DemeterF works in class (read the DemeterF documentation). The CSP Court has some deficiencies that we want to fix in the generic SCG Courts. But CSP Court is worth playing. Playing CSP Court will tell us a lot more about how SCG works and how we can reuse it. That is why we set up a tournament in CSP Court where all avatars will run on a College machine and communicate through http and the admin with each other. Work again in groups of two or three. Please choose a good name for your avatar: it will be your baby avatar into which you put your knowledge about solving CSP problems. http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/ Read the overview: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/Player/overview.html Read the Competition Set-Up http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/adminsetup.html The game rules in CSP Court are summarized here: Old requirements: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/requirements/requirements-cs4500-f09.pdf See 4.3: game rules. See also: http://www.ccs.neu.edu/home/lieber/courses/csu670/sp09/source/Administrator/admin/AdminRules.txt If you prefer them in source code: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/SCGLibs/scg/scg-game.beh In earlier courses, the CSP Court was divided into several subcourts where we played TBall, Slow-Pitch Softball, Fast-Pitch Softball, followed by Baseball. We play directly SCG(CSP Baseball with secrets). That means we play the hardest of those games as described below. The terminology changed as follows (old > new): derivative > challenge > hypothesis > claim, raw material > claim instance or problem > instance, finished product > solution. Next we give the game definition in terms of the product family that we are going to build and which is explained here: http://www.ccs.neu.edu/home/lieber/courses/se-courses/cs5500/sp11/projects/playground-designer-user-guide.html Domain Instance ******************************** CSP-formula with weighted constraints defined by: Problem = List(Var) *s Cons(Clause). Clause = "(" int *s "{" int "}" *s List(Var) ")". see http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/SCGLibs/scg/scg-csp-game.cd http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/SCGLibs/scg/scg-game.cd Check other cd files in the same directory http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/SCGLibs/scg/scg-game.cd contains Var = ident implements Comparable(Var). Solution ******************************** Solution = ListMap(Var,Boolean). http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/SCGLibs/scg/lib.java.cd nogen ListMap(K:Comparable(K),V) = "[" *s List(Entry(K,V)) *s "]". valid ******************************** all variables must be assigned. quality ******************************** fraction of satisfied weighted constraints. Claims: ******************************* Alice claims that she can come within q of Bob's solution when she claims: (CSP-secret([R1,R2,...],q). protocol: ******************************* Alice offers. Bob decides to refute. Bob provides CSP-formula F using only [R1,R2,...]. Bob provides his secret solution SB. Alice provides her solution SA. Refutation is successful if quality(f,SA) < q* quality(f,SB). ==================================================================================== old THESE WERE NEGATIVE CLAIMS!! Our SCG(CSP) software uses positive claims. Claims: ******************************** Alice claims that Bob cannot come within 0.85 of her solution for CSP-formulas containing only relation 22 if he has only 1 minute. This is summarized by claim CSP-secret([22], 0.85, 1). protocol ******************************** Alice provides CSP-formula containing only 22 and her secret solution Bob provides his solution for Alice' formula Bob refutes if he is within 0.85 of Alice quality. ==================================================================================== end old Strengthening: (for positive claims) ******************************** strengthenP(CSP-secret([R1,R2,...],q,t), CSP-secret([R1,R2,...],q0,t)) iff q0 > q (the second one is stronger). There are positive and negative CSP-secret claims. Positive: Alice claims that she can come within q of what Bob can achieve. Stronger means higher quality. Negative: Alice claims that Bob can't come within q of what Alice can achieve. Stronger means lower quality. What you need to know to write your avatar: To write a winning avatar you must have a reasonable Boolean MAX-CSP algorithm. The purpose of you developing a MAX-CSP avatar is to get a detailed understanding of the SCG Courts system to be built. You study one instantiation in detail by participating in and SCG Courts tournament for CSP. While we will have a real competition, it is not important that your avatar be "perfect". Just try to make it better than any of the other avatars created by your peers. Your MAX-CSP avatar is slightly different from a real SCG Courts avatar because it deals with money and not with reputation. A subtle difference: you cannot overspend your account. Agreeing to refute a claim costs money in this old version of the game. Another difference: you have one minute to do all your tasks. So your avatar has to spend its time in the most effective way (and not spend too much money). ========================== What to turn in: MAX-CSP Avatar Preregistration to register your avatar name and get a password: by Jan. 25. The preregistration page is here: http://www.ccs.neu.edu/home/lieber/courses/se-courses/cs5500/sp11/SCGCourtsPreReg/MAX-CSP/prereg.html In the past we used those machines: http://www.ccs.neu.edu/home/chadwick/servers/machines.html to run the tournaments. It is important to use a college machine for the tournament unless you can deal with the security issues yourself. Registration is open 6 hours before the tournament. Participate in two testing tournaments: Thursday, Jan. 27, 2011, 11.59 pm. Monday, Jan. 31, 2011, 11.59 pm. First competition: Thursday, Feb. 3, 2011, 11.59 pm. Security: Gentleman agreement: The purpose of our game is to accumulate knowledge about MAX-CSP and to develop good algorithms for solving MAX-CSP. Therefore, we make the following gentleman agreement: Tactical approaches to winning the game are discouraged. A strategic approach to your avatar is encouraged that uses good algorithms for solving MAX-CSP problems with many variables and constraints. -------------- By Feb. 7: Do a system design and an object design for the administrator generator and baby avatar generator. They are the most risky parts of SCG Courts. The generators take as input the data described in: http://www.ccs.neu.edu/home/lieber/courses/se-courses/cs5500/sp11/projects/playground-designer-user-guide.html And produce an admin and a baby avatar that conforms to the rules of the admin. The integration test is that the generated admin and several instances of the generated baby avatar can play a tournament. Turn in: (see 7.5 Managing System Design) Turn in an System Design Document for Admin and Baby Avatar Generators. Use an adaptation of Fig. 7-18 on page 285. ------------ FROM A RECENT EMAIL ------------ There have been questions about the avatar interfaces in: http://www.ccs.neu.edu/home/lieber/evergreen/specker/software-development/faq/tasks.html I tried to hide for now where they come from but it is better that I tell you: They come from the CSP instantiation of SCG. CSP = Constraint Satisfaction Problem. CSP will be explained in class. http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/Player/player/tasks/ contains the baby avatar. Starting on Monday we will use SCG(CSP): The source is here: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/ Reputation corresponds to Price Claim corresponds to Challenge Correspondences between the new SCG and the Money version of SCG(CSP) propose corresponds to OfferTask: public List offer(PlayerContext context) refute corresponds to AcceptTask: public List accept(final PlayerContext context) strengthen corresponds to ReofferTask: public List reoffer(List chs, Config config) solveInstance corresponds to SolverTask: public List solve(List chs, final double factor, long start) provideInstance corresponds to ProvideTask: public ProvideTrans provide(AcceptedChallenge ch) I hope this helps to give you information about how the avatars will work together. Browse the legacy system: http://www.ccs.neu.edu/home/lieber/courses/cs4500/f09/files/source/