I am working through one of the ArgoUML Tours and I am stuck on Build a Class Diagram: Step #11.
This step asks you to build anonymous realizations between the Teacher interface and the Grad and Prof classes. I can build individual realizations, as shown in Figure 1, below; however, I haven't figured out how I can get both Grad and Prof to show up as they do in Step 11 of the Tour.
Other than the Tour, the ArgoUML documentation is rather sparse; I can't find information on these kind of realizations in The ArgoUML User Manual. Can someone walk me through the steps to make my diagram look like theirs (Figure 2)? I am using the latest stable copy of ArgoUML (Version 0.32.2).
Figure 1: My attempt at drawing realizations of Teacher
Figure 2: The class diagram, as shown in the ArgoUML Tours - Build a Class Diagram: Step #11
EDIT:
Originally, I thought Grad and Prof were multiple realizations of the same interface. Thanks to Tom Morris for clarifying.
I suspect you're just seeing a difference in drawing styles rather than actually a Realization with multiple clients. If you grab the middle of each realization and put two bends in each to make them zigzag shape and then drag the arrowheads so that they overlay each other (easier if the default click to grid is on), you'll be able to make your diagram look like what's in the picture.
If you think of it, this makes sense since the Class-Interface relationships are really two independent 1:1 relations.
Related
I am working on a project for detecting abandoned luggage in train stations and airports. Is there some dataset that contains all kinds of bags and luggage? I searched a lot but I can't find any, and I would really appreciate if someone can help me.
Thanks!
I was also looking for this kind of dataset and haven't found any.
So my solution was to build one from the images of the COCO dataset.
download the metadata and only save labelled images that have one of these 3 classes: backpack, suitcase, handbag (further I'd refer to them as just bag).
get rid of the pictures where the bag is carried by a person. To do it, write a script that considers the bounding rects of all objects in the picture; if at least one bag in the picture has its bounding box intercepting with the bounding box of the object person, that's a good indicator that the bag is in person's hands/back/shoulder. The remaining bags may be considered abandoned.
save links to these images in a separate file and download them with CURL.
Note that this approach still requires manual clean-up after the images are downloaded, but that's the best you could come up with in absence of ready-to-use datasets.
What is ffpdm in HTML ?
I sometimes see it in a website's source code as an attribute for HTML or INPUT tag.
For example you can see it in jsSHA - SHA Hashes in JavaScript
Thank you in advance .
The one PDM I know is Precedence Diagramming Method and FF looks like Finish to Finish. Maybe I am wrong but If I am right the explanation is following...
A Precedence Diagramming Method (PDM), which is sometimes also known as the Activity on Node (AON) Diagramming Method, is a graphical representation technique, which shows the inter-dependencies among various project activities. This diagramming method is used to draw the project schedule network diagrams – for example the Critical Path Network Diagram and the Critical Chain Network Diagram.
I hope that you may have heard about another less commonly used technique in diagramming methods – the Activity on Arrow (AOA) diagramming method, which is a special case of the Precedence Diagramming Method. In AOA, all dependencies are Finish to Start, and the duration is shown on arrows. That is why, this diagramming method is known as the Activity on Arrow (AOA) diagram. PERT is an example of AOA diagram.
Activity on Arrow (AOA) diagram emphasizes on milestones (events),
and the PDM diagram emphasizes the tasks.
The main benefit of Precedence Diagramming Method (PDM) is that it shows the activity dependencies, and it also an important communication tool for stakeholders.
(source: netdna-cdn.com)
The Precedence Diagramming Method (PDM) consists of rectangles known as nodes, and the project activities are shown in these boxes. These rectangular boxes are connected to each other through an arrow to show the dependencies; therefore, these diagrams are also known as the Activity on Node (AON) diagrams.
The Precedence Diagramming Method uses four types of dependencies. Those dependencies are as follows:
Finish to Start (FS)
Finish to Finish (FF)
Start To Start (SS)
Start to Finish (SF)
Finish to Start (FS)
In this type of dependency, the second activity can not be started until the first activity completes. This type of dependency is the most commonly used dependency in the diagramming techniques.
For example: to paint a wall first you need to build a wall. In this case, first activity is building the wall and second activity will be painting. You can not start painting the wall unless the wall is ready.
Finish to Finish (FF)
Here, the second activity cannot be finished until the first activity finishes; in other words, both activities should finish simultaneously.
For example: let us say that you coding a program for a client, and the client is providing you the characteristics of the program. In this case you can not finish coding for your program until the client gives you his complete requirements. Here, both activities should finish simultaneously.
Start to Start (SS)
Here, the second activity cannot be started until the first activity starts; both activities should start simultaneously.
For Example: Suppose you have to apply primary coating on the wall. To apply the coating, you also need to clean the wall. Therefore, one team will start cleaning the wall and second team will paint it. Both activities can be started at the same time.
Start to Finish (SF)
In this type of dependency, the second activity cannot be finished until the first activity starts.
For example: let us say you have to move into a new home, and your old home has to be demolished. In this case, you can not move to your new home until it is ready. Hence, the second activity (construction of new home) must be finished before the first activity starts (you start moving into new home); i.e. if you are moving into your new home, you cannot start vacating your old home until the new house is completely ready.
Source: PM Study Cycle
Images: Slide Share
How is a class diagram actually any different to just looking at the class definition with all the functions collapsed? I've been asked to write some and realized that this is all just .. read the source .. it has comments. What's the point of a class diagram, how is it different to even minorly commented definitions, and what makes a good class diagram better than others?
Edit: Yes, the source already exists, and did so long before the class diagrams.
Another edit: People have been talking about visual vs textual tastes. That's not the definition of class diagram I was given. It's still purely textual. The sample class diagram is a bunch of text, that resembles the source code with the function definitions cut. That's the reason that I asked. If it was a genuine diagram, I could understand.
If you have one or two classes, that does not make a diference.
If you have a complex object model, things change.
And, at least for me, is easy to look first at a diagram in order to look for what I want in stead of looking at a bunch of source files.
Also seeing the classes on a picture and their relations helps to understant the ideas of the project.
I'd rather have source. Given that, I can always reverse engineer it.
You have to ask what UML is for: it's just a communication device, a way to get your ideas across to other developers. If UML is helping, great. If it becomes another burden to maintain, prefer working code with good unit tests.
A good class diagram clearly shows each classes responsibilies and associations - at an appropriate level of abstraction.
Class diagrams are useful because they allow you to design at a higher level of granularity. Operations drawn on a white board are easier to change than source code. It also clearly shows associations through lines, rather than leafing through code.
They're helpful in that they are a segue from conceptual ideas to source code.
They let you say more with less.
If the source already exists, I guess it's the old adage, "A picture tells a thousand words".
For someone not familiar with the source, a diagram may help them to grok the overall design quicker then reading the source, no matter how well documented. Some people are more visual than others. Personally, I'd rather have the source.
Like many things, it's probably a matter of taste.
Edit:
I thought the definition of a diagram was that it is visual. However, if it's just a bunch of text, then the only point I can see is that it provides an overview of intent without the unnecessary implementation details.
The difference between looking at a diagram and the source is that you don't need to process as much data when looking at the diagram (a picture) than when reading the source (says thousand words).
In my experience I've found class diagrams to be very useful when I'm not familiar with the architecture of the software. But class diagrams don't replace the need for source code and proper documentation, they're just a communication and productivity tool that complement the methods I mentioned before. Their intent is to understand the software architecture. not to replace other documentations. How useful a class diagram is depends on its quality and the complexity of it and the source code.
Don't put too much detail into the diagrams. It makes them confusing. You'll want them to communicate relationships, not API and a list of methods.
They also help to see when and where to refactor code. Use class diagrams along with proper documentation and you'll be all set.
I'm not sure quite what definition you've been given for a Class Diagram - it sounds almost as though the example you've been shown has just one class on it. If so, I can understand why you think it's a bit ridiculous.
Class Diagrams are a way to show the relationships between classes - a good one can provide a lot of information about how your system works in one diagram that rewards careful study. It allows a developer unfamiliar with a subsystem to come up to speed quickly without getting mired in the implementation details.
Here's one simple one I found with a quick Google:
http://netbeans.org/images_www/articles/uml-class-diagram/Completed-Class-Diagram.gif
Some tools (Microsoft's Visual Studio is one) contain tools that allow you to draw a class diagram once and have it automatically kept up to date ("in synch") with the code. Very useful.
I am trying to develop a strategy game and i am thinking of creating the following game maps similar to below.
(source: totaldiplomacy.com)
(source: teamteabag.com)
How do i go about doing it and what kind of software to use of books/ tutorials to follow?
Thanks
Assuming that you can draw the graphics that you need, the rest is accomplished by defining the "territories".
A territory will have
a name
a location (just a simple position would probably suffice, one for each place where you want to draw the key bits of information)
a list of neighboring territories
any other game-relevant information, such as what units are there, what resources it provides, etc.
The "hard" bit may be generating the connectivity graph. It's probably easiest to refer to each of your territories by number, as in your second image. Then, the "list of neighboring territories" for territory 14 would be 13, 15, and 23. So don't try to do this automatically, it'll be much easier (as long as the scope doesn't grow too large) to just define this manually.
In the general case, ignoring language and framework, you want to have two things:
a model, which in both those examples would store all the domains, armies, etc.
a map view, which in the simple case is an image file of some kind with some kind of tagging to indicate which bits of the model go where.
If you're looking to program games, I would recommend the XNA framework. There is alot of good resources for new programmers, head over to http://msdn.microsoft.com/en-us/library/bb203893%28v=XNAGameStudio.40%29.aspx to get started on your first game!
I'm building a game such as Same Game, when I have to create a new level I've just run an algorithm to fill the board with N colors, this algorithm fills the board at random, but obviously the levels generated this way are not all has a solution.
I have to make a function to resolve this problem, so the game can be played by a perfect player for ever.
I have a maximum of 6 color and a minimum of 2 and the board has a reasonable size (14x12) but can be modified.
The language is irrelevant.
EDIT: I don't need to solve the puzzle, I need to create levels that has at least one solution.
I've just check out about five different versions of the game on Ubuntu and I've found an answer you can pillage from!
Simon Tatham's Portable Puzzle Collection
I play about five of his games incessantly but preferred Same GNOME. I just loaded up his Same Game and it has the option to ensure solubility when creating custom games. Even has a customisable scoring system. It's all awfully advanced.
An exe and source code is available from the above link.
And the license is MIT (meaning you can use it freely in commercial games - but please donate something to him if you can afford it)
One method, which, I'll add, is rarely the most efficient, is to build the level in reverse.
It's fairly simple to do in this case though. You just start with nothing and add clickable groups with some randomness... I say some randomness, as you may need to add extra blocks to make sure all columns are filled.
But thinking about it, even then there's a possibility two clickable groups you add will touch each other and cause an unforeseen collapse, resulting in an unfinishable game. So this method wouldn't guarantee a solvable game.
You could have a look at the source for an open source version like Same GNOME and see how they do it (if they do it at all!)
create a "solved" board, and then change it using N valid but random backwards moves. After adding each backward move, you could run the moves forward (on a temp board) to verify a solvable puzzle.
If you can't run a verification algorithm, because of time constraints, perhaps what you need to work with is a library of puzzles. You can have a background thread generating new random puzzles all the time, and running a verification algorithm on them to check if they are valid. When a valid puzzle is found, it is added to your library of puzzles (assuming the same puzzle doesn't already exist).
Then your game just loads randomly from the library. This allows you to ensure you always have valid puzzles, but still allows you to randomly generate them and verify them without slowing down the puzzle-loading.
I think the best way is, if you generate a level randomly, I mean add 1 or more blocks at the same time to the same column, so you're gonna have some connecting blocks. Then you write a simple solving algorithm, which just solves the board till there is no more possible moves. Then you just simply try to complete the remaining part, just pushing some blocks from the top so that you have some more blocks to vanish. You continue till you finish the board.
You store the pieces you added in another matrix.
After that you just have to add the 2nd matrix to the 1st from the top. If the board is not full, you simply complete the board with blocks to start with(connecting blocks).