MaDKit forum

Welcome All !
Please, use explicit topic names when creating new threads. Thanks.

You are not logged in.

#1 Re: HowTo » Suppress Viewer Windows » 2016-05-04 22:43:57

Ah thank you, thats exactly what I wanted

#2 HowTo » Suppress Viewer Windows » 2016-05-03 21:13:08

oxality
Replies: 2

This may seem a bit odd, but how would you hide the viewer JFrame that appears during simulations?

I am trying to consolidate all the windows into a single new JFrame, but the old JFrames still appear.

I have tried

launch(agent, false)

and

@Override
public void setupPanel{
this.setVisible(false);
}

I also need this solution to work for the watcher control and information JFrames, but I have not begun to investigate those just yet.

thanks

#4 Re: HowTo » Launch nested/inner class » 2016-03-11 00:22:30

This worked, thanks. However now the panel for that AbstractAgent doesnt pop up. Any output set through logger just goes to my IDE terminal. Im just using the inherited setupFrame method if that matters

#5 Re: HowTo » Launch nested/inner class » 2016-03-10 01:36:23

ah ok. is there a way to pass values to the new Agent when you launch it, similar to the way you can pass values when constructing an object? Ive noticed AbstractAgents ignore/dont require constructors

#6 HowTo » Launch nested/inner class » 2016-03-08 19:25:10

oxality
Replies: 6

I was wondering if there was a way to launch an inner class from the outer class. For example

class outerClass 
{
    main()
    {
          ///code
          new Madkit("--launchAgents", innerClass.class.getName() +",true;" + ConsoleAgent.class.getName());
     }

class innerClass extends scheduler
{ 
     activate()
    {
         //code
    }
}
}

This gives me an InstantiationError, i guess because it cant find the correct class name?

#7 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2016-03-07 21:22:30

fmichel wrote:

OK, maybe that what you want could be done by using several activators in your scheduler (one per task). Did you try that ?

No, but i will try. I think Ill be able to make it work though, thanks for the suggestions.

#8 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2016-03-05 02:48:17

fmichel wrote:
oxality wrote:

Is there a way to launch into a certain method after checking the mailbox, but have that method span over multiple steps in the simulation?

Not sure about what you want to do here, could you describe a use case ?

So i have two entities, a console with a task list and a robot. The robot asks the console for a task (end step) the console responds with a task (end step) the robot then begins the process of moving to the work area, which i would like to span over multiple steps. In this case, the robot moves grid unit to grid unit, so preferably moving to an adjacent grid unit would take up one step.

#9 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2016-03-03 23:17:29

fmichel wrote:

Not sure that this will help but here is a first reply: You can work with AA and communicate by checking your mailbox each turn. Also, be aware that you can use a scheduler on agents from the Agent class. Finally, you can mix agents from any type.

Thanks for the reply. I may check the mailbox each turn, i didnt think to do that. Is there a way to launch into a certain method after checking the mailbox, but have that method span over multiple steps in the simulation?

Also, how does the scheduler interact/affect the regular Agents?

#10 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2016-02-24 05:07:46

Sorry to resurrect a dead thread but I had a question about abstract agents vs agents. Im trying to have three+ separate objects communicate with each other so i made them into agents. This worked well, but i was unable to slow the simulation down into "steps" like with abstract agents. However, with abstract agents i find myself in a jam because I cant have one object loop while waiting for a reply message. Is there anyway to apply a timeline of sorts to agents? and is there anyway to have two abstract agents communicate with each other without explicitly defining the send-receive-reply-receive process?

Board footer