Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: dragonlordged on November 02, 2009, 04:48:39 PM
-
I have a question for the regulars who contribute code here. I came to your site through Wikipedia, which calls Darwinbots an Open Source Alife sim. I've done a bit of digging and found a file called ReadMe- Copyright notice.txt in the SVN repo for the code. I'm concerned that the restriction of use (part 3) doesn't fit the requirements of 'Open Source' that I've been taught. I'm looking around for an Open Source project to contribute to as part of a college project and would really like to help out with Darwinbots, but I'm not sure my professor will accept the project. Does anyone have any ideas to help me?
dlg
-
It's open source in that the source is open to view and edit, but no, it's not really Free Software in that sense...
Darwinbots3 (still being worked on) is MIT licensed, though, so if you'd like to contribute and want an Open Source license, that'd be the way to go The downside is that there really isn't enough of Darwinbots3 put together yet for screen shots, so it wouldn't necessarily make for a compelling presentation if that's the end goal. Right now it just passes (most of) the unit tests written for it.
Darwinbots3 is organized like a commercial product (in that it has any organization at all ), so it would be a good experience if you haven't played with largish (tens of thousands of lines of code) projects. And I'm always around and am more than willing to bend over backwards getting you (or anyone) up to speed if you want to contribute.
What sort of emphasis is your project? Like is the goal more web based technologies or application programming? I'm guessing it's application programming. Do you have a particular area in mind as far as graphics, physics, math, GUI, etc.? Also, DB3 is in C#/.NET, for what that's worth.
If you let me know what sort of class it's for I can probably think of a nice self-contained pass/fail sort of task that would make for a good presentation (assuming a presentation is required...). I used some of Darwinbots2 for an algorithms class and it went over rather well. Especially if you're math savvy, I have a cool project in mind involving splines that I don't have a ready baked solution for, so it would have a good bit of research/original research and implementation going on, and at the end you'd have a nice "this is the brute force solution" vs. "this is my solution; see how it's faster?" presentation.
-
I have a question for the regulars who contribute code here. I came to your site through Wikipedia, which calls Darwinbots an Open Source Alife sim. I've done a bit of digging and found a file called ReadMe- Copyright notice.txt in the SVN repo for the code. I'm concerned that the restriction of use (part 3) doesn't fit the requirements of 'Open Source' that I've been taught. I'm looking around for an Open Source project to contribute to as part of a college project and would really like to help out with Darwinbots, but I'm not sure my professor will accept the project. Does anyone have any ideas to help me?
dlg
Well, DB3 is under the MIT license, it doesn't get a whole lot more open source than that. And looking at the (incredibly old) license in the DB2 repro I don't see how:
(3) Without the agreement of the author redistribution of this product is only allowed
in non commercial terms and non profit distributions.
is actually a problem.
-
From the non technical standpoint I'd not imagine problems. Propose and see if he takes offense. If he does there is a real problem. Maybe not a big one, so ask why the current way of working of DB is unacceptable to him. Ask to judge on what is is rather than on what it is not.
-
I haven't seen the source for DB3, but from everything I've heard I think it would be the best project to work on. It may not have a lot of fancy screenshots, but it has proper unit testing and structure. Also since I think people are working more actively on DB3 there will be more guidelines and support.
I don't think the source for DB2.43 is a great example to follow, theres a lot of legacy and spagetti code in there.
So I would recommend DB3, although I haven't looked at the source myself
And I'd immagine it would still be possible to use screens from DB2 for a presentation, just to show what the end goal of the project is by refering to the previous version.
Also it sounds like the licence shouldn't be a problem if it's for a college project, but it might be that final projects have to be submitted to a publisher. Some universities publish their own papers, but others use a publisher which then requires a fee from anyone wishing to read the paper. (Something I'm firmly against, but what are you gonna do...)
-
So here's the scoop. The class is called Open Source Software, and all they require is for me (and my partner) to get involved with an open source project. Unfortunately, I don't know C#, but I do know C++ and have heard it's an easy port. I haven't checked with the professor yet, but if DB3 is under the MIT license, I don't expect any problems.
Also, someone should update the wiki or website or something to say that DB2 is no longer under construction, because I was under the impression it was still being worked on and that the repository was still updated regularly.
dragonlordged
-
Welcome aboard then
I'll see if I can find a nice place on the wiki to describe the current state of affairs. Mostly I don't want to turn anyone off to DB2 development, because there are some rather serious bugs involving things like floating point overflow/underflow and a Visual Basic wizard (yes, it was written in visual basic) might be able to cleanly fix them all. But yeah, it's not a pretty sight
For the curious, you can browse the SVN repository with your browser. DB3 SVN server (https://svn2.hosted-projects.com/Numsgil/Darwinbots3/). There's also a Darwinbots chat for developers. If you need real time assistance I try to keep the window open during work and at home, so I'm probably going to be reachable with any questions ~12 hours a day. Check out Developer chat (http://chat.darwinbots.com). The page takes a while to load and seems to only work under Firefox for some reason, but other than that it's pretty straightforward.
I have a page (http://www.darwinbots.com/WikiManual/index.php?title=Darwinbots_3) which describes what you need to do (with no assumptions about what you know) to get the code compiling and running. Right now there isn't really a Darwinbots application; it's just a collection of sub modules (graphics, physics, linear algebra) that are still being worked on. Once they're mostly complete I'll use them to build the Darwinbots3 application proper. Each sub module has its own solution (with unit tests and the like).
Be sure to note (or just change yourself) and instructions there that are confusing/unnecessary/plain wrong.
-
Hey guys, just making myself known. I do have some C# experience, so maybe that'll come in handy.
-
Hey guys, just making myself known. I do have some C# experience, so maybe that'll come in handy.
Sure, same thing. If you follow the DB3 wiki page you can get the code compiling. And I try to be helpful if you have any problems with it. Most of what needs doing is pretty math and/or graphics heavy, though. So fair warning.
-
Not sure we've got the background to do the heavy graphics stuff. Found a page off the wiki that describes a Darwinbots 3 'Wish List' at http://www.darwinbots.com/WikiManual/index...ots_3_wish_list (http://www.darwinbots.com/WikiManual/index.php?title=Darwinbots_3_wish_list). Is this up to date? I at least have some (academic) knowledge of networking, and feel that I might be able to implement one of the two features under that category. Is this something that still needs to be done?
dlg
-
Yes. In fact, if you're comfortable with web programming in general (PHP/ASP.NET, setting up servers, etc.) I have a grand master plan involving a virtual private server that would make for an interesting project. Though that would be less about programming and more about setting up a web server, so I don't know how appropriate that would be for your project.
The first one (program automatically knowing when new versions are available) is something you could set up for the current program, even. I'm not sure how big of a project it would be, though. The hard part would be potentially updating shortcuts once a new version is downloaded. Or maybe you could write a program that automatically chooses the most recent version and runs that, and then all that would be required is an automatic restart of the current program.
As far as having the program let you download bots directly from the bestiary, the hard part is setting up a web interface for users to add their bots. The basic work flow I'd like is for users to write a bot and go to a certain page in a bestiary site to upload it. The site would tie in its login to the forum (might not be possible with our current forum software, but I was thinking of switching for DB3 anyway) and wiki, so there would be just one login. The user could even come back and (in a version controlled way similar to the wiki) post new versions of their particular bot. You could set up tags describing the bot you've built.
Then inside the program it browses bots in the bestiary and lets you download them. There isn't enough of DB3 right now to work on some of the integration stuff (I was thinking of something like having bots come with "demo settings", so you can just one-click and get the bot running on your machine to see what it does), but you could certainly set up bestiary browser. If you were to do the web side of things in ASP.NET, you could probably share much of the code between the web site and the actual program. You could even do something simple like hook in to the .NET web browser controls and just web browse to the bestiary maybe.
You wouldn't necessarily need to program this all from scratch. It would probably be better if you didn't, actually, since we could take advantage of upgrades and the like. But I don't know what the requirements for your project are.
Basically I'm being really picky for DB3 stuff, so development would be sort of "agile". You'd present plans and get feedback from me. You'd partially implement them, and I'd play around with them and give feedback, and you'd end up scraping large sections of code and try again as I annoyingly change my mind without any real idea of what I want
There's also a task list (http://www.darwinbots.com/WikiManual/index.php?title=Darwinbots3/Tasks) if you want to look over it and see if there's something there you'd rather work on. An error console would be a pretty cool project, too. You could build a base "console" type widget we could use in other places, too, and then use that to build a nice "oops, Darwinbots has crashed, send error report?" widget.
Also, which time zone are you in? I'm in Pacific time.
Sorry for the wall of text
-
As far as having the program let you download bots directly from the bestiary, the hard part is setting up a web interface for users to add their bots. The basic work flow I'd like is for users to write a bot and go to a certain page in a bestiary site to upload it. The site would tie in its login to the forum (might not be possible with our current forum software, but I was thinking of switching for DB3 anyway) and wiki, so there would be just one login. The user could even come back and (in a version controlled way similar to the wiki) post new versions of their particular bot. You could set up tags describing the bot you've built.
Didn't someone already do this? It was a separate login, btw. And not in the program self. What happened with that?
-
Shasta has something in cakePHP right now so that would be a good place to start. I think we want to use asp.net, though, since that would make it easier to bridge the gap between the web side and app side.
-
Currently I'm still stuck getting the code to compile correctly and run the tests. I think we'll be starting off with the console functionality.
-
I'm on a business trip till Friday, so we can't do the chatting thing. What sort of problems are you encountering?
-
So when I run the BuildAll scripts, I get a 'Visual Studio 9 cannot be found' error. I've tried reinstalling Visual Studio, but had no luck. I believe I have all the dependencies installed correctly. Any ideas?
-
Which version of visual studio do you have? You'll need at least 2008. I have only tested it with express and pro. Also what os version are you running? Any different results if you run as admin?
If you have vs2010, it should work but I haven't added support in the scripts yet.
You also don't need to run build all. The binaries are checked in already. It's mostly there as a fallback.
-
I've got vs 2008 (9.0) and am running it in Vista. I didn't try running as admin, but I'll try that. I'm not sure how it's expecting to find Visual Studio in the path that it's looking in, but we'll see if it can find it now, after I finish reinstalling.
-
It looks in your registry to find paths, actually.
-
Well, it's not finding Visual Studio. I'm confused. I'll look at it later.
-
Do you have 2008 express, pro, team, or something more exotic?
-
Express.
-
Can you check out the scripts and find which registry key they're looking for? And then check the registry yourself and see what lives there?
-
Okay, the line I think pertains is in SetUpVSPath in the Helper Scripts.
FOR /F "usebackq tokens=3 delims= " %%R IN (`"reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCSExpress\9.0 /v InstallDir | find ":\""`) DO SET DB3_DEVENV_PATH=%%R
At HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCSExpress\9.0 is a folder containing a bunch of registry stuff for Visual Studio, as I expected. I'm not sure I get what /v InstallDir | find ":""`) does, though.
-
Okay, under that registry folder you should have an InstallDir key. What is the value it has?
-
It's C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE, which is where my devenv application is located.
-
Hmm, can you try running your IDE from the command line using that path? Things should work... You can also try turning echo on in those batch files and see if something is weird looking.
-
It seems to be the correct path, and echoing SetUpVSPath shows exactly what I expected (fails to find Visual Studio and VCExpress), but I've still got nothing.
-
I'm stuck using my iPhone till Friday so I can't help debug too much. Good mews is that you don't have to use the scripts. The binaries are in the bin directory and the scripts just build using the regular solution files.
O you can also just post the complete output of the scripts with echo on. I might beable to point you in a useful direction.
-
So yeah, the problem currently is that, since I can't just run the scripts and watch it compile, I can't seem to find anything central (which would be the optimal place to put console features). I've tried building a few of the projects in the repository, but most of them will build and will not run "A project with output type of class library cannot be started directly." I mean, I can see that this project is very modular based on your svn setup, but there's got to be something central to the project in some sense. Any ideas?
-
There's actually nothing central. It's a little weird, but I started very bottom up with the whole thing.
Each module has the core library (dll) and unit tests (exe). The unit tests get run automatically when you build the module solutions. Failed tests get treated like compile errors. You can set the unit tests to be the startup binary I you want something to run.
For an error console dig in to ui.controls. It has a few custom controls already. It also has a "testbed" that should auto detect new controls and let you play with them.
For the console itself:
1. Different categories of console output will exist. So there should be a way to enable/disable console categories from displaying.
2. Different colors should be possible for text. I'm not sure yet what I'll use it for though. Maybe different categories are different colors.
3. I rebuilt a MFC console for something at work. I replaced a cEdit box for the text with a CList box. That was the secret for making it fast. Not sure what that means fir .net though.
4. Not sure how familiar you are with unit testing. But it's especially important to figure out how to test ui controls. You can test that categories can be turned on/off for instance. Let me know if you need help figuring out the unit testing framework.
5. The console itself should be a control, not a form. It should "fill" it's parent container, though. Let me know if you need help figuring out how to do that.
...
I'll try to give you write access to the svn tonight.
-
Just a quick question. What's UI.Winforms? If I remember, I couldn't even get it to compile. I'll take a look at UI.Controls.
-
Winforms is a dumping ground of various attempts at core darwinbots windows and forms. Like the sim opts in db2.
It just needs a good critical pass over it to see what's worth keeping and what needs more work. It's ignorable for the moment.
-
UI controls compiles and runs for me, but yes, the UIwinforms doesn't seem to compile when you open it (Missing symbol "Gl" and missing library "Tao").
-
As I said, uiwinforms is a dumping ground of different things. It's not surprising it might not compile (if you install Tao on your machine, you might be able to get it to compile). It's entirely ignorable for the moment.
-
Numsgil, I'm going to start adding some of the stuff you've told me and the stuff I can figure out about the code in as comments, because I have had no luck figuring out how this project works and therefore can't really figure out how to add to it. I'm thinking that by adding more comments at least I can help out anyone who wants to contribute later.
-
Sure, sounds like a plan.
...
Not sure if you've ever played with a project that was unit tested like this, but one of the ideas of unit tests is that they are "living documentation" about how to use the code they test. There isn't really a "program" to run, so traditional methods of wrapping your head around a code base don't really work here. Trying to think of it in a "top down" manner won't really work. You have to think about things in a far more modular way.
Speaking of unit tests, if the way in which an individual class should be used isn't immediately clear, consider writing a "use case" unit test as a "living comment".
That said, there is a picture which describes how modules are supposed to fit together that might help things make sense. You can find it here (https://svn2.hosted-projects.com/Numsgil/Darwinbots3/Trunk/Documentation/). UI.Controls isn't listed, but basically it'll be a sub module of UI.WinForms.
-
That image is quite useful, but I still think several of the modules could do with commenting in their code at least at the top which simply describes what they are supposed to do or what they're for. I mean, just looking at the repository, you'd think that Core is the only folder you need to look in and that all the others just make libraries that add on to the functionality of Core, but that's obviously (to me now) not the case. As a beginning contributor, I have little idea of what to add to and how to add it without more documentation than is available.
From my personal experience, while unit testing is an incredibly useful supplement to documentation and comments, it's not enough on its own.
-
No, you're right. The code itself could do with some documenting, particularly at a high level. If you want to add a high level file describing the modules and what ( you think) they do, it could go in that same documentation folder. I'll fill in any gaps or errors if you post an initial draft to that folder.
Mostly I've been doing my best to limit how much of other modules you need to understand to be productive. I don't want the code to grow to the point where the only way to make changes in one part is to understand how it fits in the whole.
-
Okay, I'll start to work on that later tonight. The only one that I can't begin to understand yet is the Azimuth module. Can you give me a brief rundown so I can get a picture in my head before I start running through the code?
-
Azimuth is a math library. It's like a tool box. Each folder is a group of related tools in the toolbox. DenseLinearAlgebra has tools for dense linear algebra. Polynomials has tools for finding roots of polynomials. Etc.
The core workhorse of the whole thing is the Scalar structure. It's a wrapper around either float or double (depending on what the user compiles with), and allows me to do things like a == 0 with a clear conscience. It also overrides ToString() so that it only outputs significant digits, and I'm working on adding a counter so I can easily count the number of FLOPs a complex operation does. Pretty much everything builds on top of Scalar. It's also a horribly ugly structure, but I think that's just the nature of the beast for something like that.
-
Numsgil, I added README files to most folders in the Modules folder, describing what (I think) they do. I also added a few other READMEs to help repository navigation. See what you think and tell me if I got anything wrong.
-
Mostly correct. UI.Controls will probably remain a separate module from UI.Winforms because .NET form designers prefer custom controls to exist in external libs instead of in the same lib.
Also I've been following the convention of using About This Folder.txt instead of README.txt because I,, at least, tend to ignore READMEs because they're almost never useful. Whereas "About this folder" tells you that the file contains information about the current folder, so you can decide whether or not it's worth your time to read. But minor point all in all.
I'll try to go back through and expand them out a bit later today or tomorrow.
-
I suppose so. I'll go change that around shortly.
-
So when I run the BuildAll scripts, I get a 'Visual Studio 9 cannot be found' error. I've tried reinstalling Visual Studio, but had no luck. I believe I have all the dependencies installed correctly. Any ideas?
I fixed the problem with this now, btw. Windows 7/Vista used spaces instead of tabs as deliminators. Made the whole thing a huge pain but I've fixed it and I've tested it on my new Windows 7 64 bit laptop with C# express.