MASON-INTEREST-L Archives

October 2015

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 27 Oct 2015 13:51:03 +0000
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
multipart/alternative; boundary=f46d043c7de6f4ec5d0523165e07
From:
Ernesto Carrella <[log in to unmask]>
Parts/Attachments:
text/plain (1184 bytes) , text/html (2108 bytes)
Okay,
To kill off the agents thread can't you just feed them a runnable that ends
when the model ends?
To kill off the display associated with them, tell the agents thread, right
before it ends, to release a permit to an external  (and initially
empty) semaphore.
Tell the thread calling dispose() on the jframe to acquire X (number of
agents) permits from the semaphore before  killing the jframe and it should
coordinate by itself.

Understand however that concurrency is easy to screw up and you might want
to bone up on it rather than trusting my foggy memories of it.

On Tue, Oct 27, 2015 at 1:43 PM Rashi Aswani <[log in to unmask]>
wrote:

> Hi,
>
> You have X agent in each simulation, right? You have Y simulations you run.
>> Do you have Y threads running or do you have X*Y threads running?
>>
>
> Yes, I have X agents in each simulation and Y simulations, and each
> simulation has a thread for each agent so X threads in one simulation. But
> I want to kill the X threads and corresponding display of first simulation
> before starting a new simulation so its a sequential process, I wanted to
> know if there's a way to kill the X threads and corresponding display for
> it.
>
> Thanks,
> Rashi
>


ATOM RSS1 RSS2