LISTSERV mailing list manager LISTSERV 16.0

Help for MASON-INTEREST-L Archives


MASON-INTEREST-L Archives

MASON-INTEREST-L Archives


MASON-INTEREST-L@LISTSERV.GMU.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

MASON-INTEREST-L Home

MASON-INTEREST-L Home

MASON-INTEREST-L  May 2019

MASON-INTEREST-L May 2019

Subject:

Re: masonclj: a library to ease use of MASON with Clojure

From:

"Abrams, Marshall" <[log in to unmask]>

Reply-To:

MASON Multiagent Simulation Toolkit <[log in to unmask]>

Date:

Sun, 19 May 2019 01:10:14 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (63 lines)

Thanks Sean!  Yes, that would be great.  I’d prefer a link to my repo, if you’re willing to do that.

I don’t think that ABMs necessarily have to be so stateful, but it is a natural approach.  I think it depends on the model.  (I have a more moderate view about this than some Clojure people, who argue that you can always, in theory, make a productive ABM without much state.  I think it depends.)

(When I was first experimenting with MASON, I got a Clojure version of the Students model to about 50% of the speed of the Java version.  I did use refs, but not all that much.  The main trick is to use Clojure’s deftype data structure for in a particular way to create your agents, rather than using defrecords or maps, which is how one usually does that sort of thing.  However, that means that you have to throw out all sorts of normal coding practices for Clojure.  I have been finding that using Clojure with defrecords in a semi-functional semi-stateful way works well, and allows me to write Clojure the way I want, for the most part.  It’s more than fast enough for my needs.  I don’t consider speed a problem at all.  Some of my notes at the masonclj repo have to do with speed, and one can see from the Example app there how I do things.  It requires a bit of study beyond the usual Clojure methods, becase in the end I have used most of the different Clojure-Java interop tricks, which have different benefits in different contexts. I don’t think most Clojure programmers have bothered to learn all of this stuff; there’s usually no reason to do so.)

Marshall

Marshall Abrams, Associate Professor 
Department of Philosophy, University of Alabama at Birmingham
Email: [log in to unmask]; Phone: (205) 996-7483;  Fax: (205) 975-6610
Mail: HB 414A, 900 13th Street South, Birmingham, AL 35294-1260;  Office: HB 418
Website: http://secure-web.cisco.com/1SJkuT4zHJ9r5d6i31XBlrEOmZMRBezEEB0MT6dDmBFsHY3aT-OwQlCdnpMOGW8HwuYdguKkBbWvmpg9Ve4awoTP6zeiR4FFmxJENxEH0j7xoNLsiGkYV9x8NLvHfBXZRX3_nu0IJzV1dTpzludtWgEy4zDdIYyGJCUaxd7YLJ1QqL-V0lldZ1ld2PttTnzHEhJFm9YePN6FjU9fYussFMrtXwvFX-Hw0VBD92-Oe2QhJ1Fkl2qibihG2JaBaa2nSyLvCbeuv423KWDLv38Nk2uap--44oFCH8a78qSBWW_sku-G0s4KLmYueDRW2mIrm1wG23k5F0mrfWqgE60PAf9w-h_s7QRMhZpNMrs-mAKEX5-FrLzCR7obQFzqVA3vBXCnmIj20pvZcKxOVLSOPEROqEYKcX4N7lZxXX5L28rX4fQFqqgtIzLyERd0mmUtedvLqSHc40ty7yHWinFDz3g/http%3A%2F%2Fmembers.logical.net%2F%7Emarshall


> On May 18, 2019, at 5:38 PM, Sean Luke <[log in to unmask]> wrote:
> 
> Marshall, there are a two ways that we can involve your library:
> 
> 	- Include a link on the MASON web page to your repo
> 	- Let you move (and manage) your repo in MASON's contrib directory
> 
> I'd be happy to do either of these.
> 
> I've seen you've noticed that clojure has some efficiency issues with MASON.  We also built a clojure wrapper library many years back, and found similar problems.  The basic issue that got us was that idiomatic clojure tries to be immutable, but agent-based modeling is *extremely* stateful and mutable.  This means you had to wrap everything with tons of Refs, which just destroyed the performance.  :-(  :-(
> 
> Sean
> 
>> On May 18, 2019, at 12:56 PM, Abrams, Marshall <[log in to unmask]> wrote:
>> 
>> Hi everyone-
>> 
>> Just wanted to let people know that I created a small library for use of MASON with Clojure: https://secure-web.cisco.com/1as6I-TdYImGD4IPIiaIK-fSUd9O4iYNgmp1c8ohOKK1AKT89i_xbMuQZwJh3O7ln48_a4SROi6mXeGvc-A9BJxum0sxJzyR7nOMuiFw2mJC2k6_7fat_krLXBDjZqmyv6dOHmKTFl39Za5DRgWPzuwSiPu61LeOEvkC-sOx_4OO2y8Z1t_tCnpNPzA_X3heSZ3IT7CW831CRM-_NkxwvpfQqrS_YGhbUGLP1i3frSy0HpaqR63sz4bI7iBySc7SpBptopXsgWKWJX_nJSDrjQkk7Rp_x3wskHfdna5VJep97W_VkamHQYOb4NNSrkdfahGEHUt4AVZWg6oj5qE78Whcxd8__sS8iWctljeAQwDmzGRVVz_8xl67Afl93Fbjv4FVvMI8mwqOmigJYbAle66o8pBFJ0OAvFhTm8qtHqgHxzNGsbxMpnoK_jXbIYtom67FzZvqiMXSplvjJgo7L2g/https%3A%2F%2Fgithub.com%2Fmars0i%2Fmasonclj
>> 
>> 
>> The focus of masonclj is not on making code as fast as possible--although there are some Clojure type hints added automatically that might help--but rather, on making it easier to get the full benefits of MASON in idiomatic Clojure code.  masonclj provides functions and macros for two purposes:
>> 
>> • Making it easier to define parameters for control of a model via the GUI and the command line.
>> 
>> • Making it easier to track agents using the MASON inspector facilities, if you use defrecords to implement agents.
>> 
>> Essentially, getting this stuff to work with idiomatic Clojure code--which is mostly functional in style--requires some extra work, and masonclj does most of the work for you.
>> 
>> The masonclj repo includes a toy program illustrating use of masonclj.  (My pasta repo contains a full-fledged program.)
>> 
>> 
>> Please pass the word on to any Clojure fans you know who want to get into agent-based modeling and might like MASON.
>> 
>> 
>> (There are a few minor things to be improved that I know of, but rather than wait until everything is perfect, I thought I'd announce the library now.  Feedback welcome.)
>> 
>> (Why not make it easier to write fast code?  I've tried this, and making Clojure as efficienct as possible with MASON requires using Clojure in unusual ways that deny the programmer of much of what makes Clojure attractive in the first place.  Java is a better choice for fast MASON code.)
>> 
>> 
>> Marshall
>> 
>> 
>> Marshall Abrams, Associate Professor 
>> Department of Philosophy, University of Alabama at Birmingham
>> Email: [log in to unmask]; Phone: (205) 996-7483;  Fax: (205) 975-6610
>> Mail: HB 414A, 900 13th Street South, Birmingham, AL 35294-1260;  Office: HB 418
>> Website: http://secure-web.cisco.com/1dR7yuKO0cyRQGODEX0UVmyouHQdq93OCm_uqvTZBENYHgyUjJGCd_JcXiMrbRqTnK0Wy08nXnRLg7LeYhoxy1td098y6zagxC0-iRaUpTLgpu5BEIgyXOgLLg83IDSXTRfhOZflVEAujVSi8_vluoxxf9NFV4A6PhgHcGNZALUAh0-duxpQ7dtNVDuoC4xwJ2QJ51XAvdPgg3DzxzR9_24WzWNGoVbccKZL0MvMkRXH_CUdbeSRNoF2yLzl0Dnewn0fBR-eG9M2pgH3jRoBp43TivdOe4toeDwphaPMQ6H_B5phsfq6-T89cCwxe98oWqynAqe0UBCxlPf05YraedLZj1RvD3JIdriWg2E-3WDjAtEhIHloeDLtoFIrgaI4fPXMdgLolcH5nVlQMmJFL1_EjZI-EEp0xCksDi_w3iMjvvL7-LvHYGVp6Cz43jVQflmOuRIoX9R0WVwpV4iq1Zw/http%3A%2F%2Fmembers.logical.net%2F%7Emarshall
>> 

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

August 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
October 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
September 2017
June 2017
May 2017
March 2017
February 2017
January 2017
December 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
February 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
July 2004
May 2004
April 2004
March 2004

ATOM RSS1 RSS2



LISTSERV.GMU.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager