nagyistoce / tin-man

Automatically exported from code.google.com/p/tin-man
GNU General Public License v3.0
0 stars 0 forks source link

Error on compile for: "host.Run (new SampleAgent());" #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download the dll
2. Create a Visual Studio 2010 project (or mono project (i tried it under 
ubuntu also))
3. Add the reference to the project
4. Use the code below (from the Getting Started Page)
5. Try to build the project

Using this Code:
*********
using TinMan;  
class MinimalAgent : AgentBase<NaoBody> {
   public MinimalAgent()       : base(new NaoBody()) {}    
   public override void Think(ISimulationContext context, PerceptorState state)     {    
     // TODO kick goal   
  }     

 static void Main()     {     
    // This call blocks while your agent runs    
     new AgentHost().Run(new SampleAgent());    
 } 
}

*********

at host.Run (new SampleAgent());

The error found is:
Error   1   The type or namespace name 'SampleAgent' could not be found (are you 
missing a using directive or an assembly reference?)    E:\Univ\Misc 
Code\Robocup\CSharp\Test1\Test1\Main.cs 28  18  Test1

Tried it using Visual Studio 2010 in Windows 7.
Tried it using Mono in Ubuntu 10.04

Please contact me at: faizan@faizan-kazi.com if you can tell me whats 
happening...

Original issue reported on code.google.com by faizan.k...@gmail.com on 7 Oct 2010 at 11:07

GoogleCodeExporter commented 9 years ago

Original comment by drewnoakes on 7 Oct 2010 at 12:16

GoogleCodeExporter commented 9 years ago
Hello Faizan,

Thank you very much for reporting this.  I must have made an error while 
copying and pasting into the documentation.  The code should read:

using TinMan;  
class MinimalAgent : AgentBase<NaoBody> {
   public MinimalAgent()       : base(new NaoBody()) {}    
   public override void Think(ISimulationContext context, PerceptorState state)     {    
     // TODO kick goal   
  }     

 static void Main()     {     
    // This call blocks while your agent runs    
     new AgentHost().Run(new MinimalAgent());    
 } 
}

At some point I had called it SampleAgent, but then I decided to make many 
samples, and this code wasn't updated properly.  The wiki is up to date now:

http://code.google.com/p/tin-man/wiki/GettingStarted

Thanks again, and please let me know if there's anything else I can help with.

Original comment by drewnoakes on 7 Oct 2010 at 12:20

GoogleCodeExporter commented 9 years ago

Original comment by drewnoakes on 6 Apr 2011 at 3:00