Print

Print


Robert,

You mean Clojure’s built-in interop facilities?  Yes.

There are different ways to do this, and I have settled on particular strategies for different aspects of MASON (though I’m open to alternatives).

If it would be helpful to see details, the code that creates the Properties objects is in a file in a small library I’m writing:
https://secure-web.cisco.com/1EHCBgW6rcObexsKekTYAk5i0PfWtamB1xhxuqy7SE7BCvtCqJS8QqAKV-qmIdEMjqrIl1nBF7YbTv42UR66t5XPVwpuYqggZ6vK5oqbOlVCfjBALNfBfSe3QOmkAF3IV50nbmDm2_PBA9WIIzVC3x02WRnL2bghklITmuZYqkq8zPYF1_I3B21gKhBqcl1iUGEevsEwbuOD71RRyZw1E8aJSaVDQ78maW4PhYm0neeRwTxq4zHwtcuIvLUh_nCjcYT38_m8OrH-JjfmfZCMYsJOgXG4oa545AY9eyx_OkgQZv1zUFv42GvZs0D3xH57uC58ZI2OoPU7oWkAc7QJtcdDQfec5HAYZEA8EfrjQA8aK_hBsSk9MhAujQ-Xd5KUyB44nExYoECbOntahUAqtkMT0r-DyoLf5oaOQyVGGLG0/https%3A%2F%2Fgithub.com%2Fmars0i%2Fmasonclj%2Fblob%2Fmaster%2Fsrc%2Fmasonclj%2Fproperties.clj

Here are examples of use of that code:
Simple demo: https://secure-web.cisco.com/1yjkTAs7u6SGWPnyqUTgW_BsVNP07q5MzQYmIHXzWKVvtUoK2IMcFfykdqGuBLx8g4nIBQLuJzbS8qXbWbwBA2u3PIs0RD-hmMkwEJMSgx_gD597goPGxsyzXu9oAhp8Uaeu5KJ1NAasmH1oEQMZ0eu0fkVKjhCYNxl3FclQoArOJF8oZ6FD6Px20XXBo6vgMtd7d12Mn3DtVQ9Ro1qLM74BPK_MLEHJAJuxdGb5bbdeAMv6jO7RTMO-QyAQJwgDaJyCWCajXT2oXcAlVzwQ6WBARCqqhrXR7-79KJwqty6uruxWPImBcU7px8rpsts-xH-8Wmt1duSUYHrkfok8X0-Qt83FNhdYkg7TiqNNFL6s560NpIZwvKAnZA34GZhgYaGUfF0uRfG17Hg21gWRT_XiZZ3W5Ge3vDXJJhucxkf8/https%3A%2F%2Fgithub.com%2Fmars0i%2Fmasonclj%2Fblob%2Fmaster%2Fexample%2Fsrc%2Fexample%2Fsnipe.clj
Full-fledged example: https://secure-web.cisco.com/1VdRbse0WU-t3sWSbKnLiUbc25sTGUNPR_2wpwDX3nimQ1wh42KqJUBQgBNgZCvq_xCySU3EGn1MhN8ZEMa-YVGJaOx9qUYKivOIF99xxwORsXAp8z6pnSa0Xqt0rBH1iEj74xns92QIRWABROrSuRKkkrdHrL1gmZwP-s1JqJB9orUsCBU07i9ijd1H7Vhs3v1Thf_f352sUAaDD4xLB-rBuSbauYR1geWS-CVZTx4jbmBln0lcCYpLP6a4CpXZRtQFp4ANmZ7ogGRYQ5hFhqSFy29XlXzsS4J5pHawQrHkqro5rK7aOrBUSbUSEK1MGRyCvJ80Ao_eKoaKzeMYciLrBES9IXYPm8-8sR-S43eUbO8Tze6x0xrqpSSDK86AgsIArhxjFY3Bv2n_lEAjp5Z-5sOEsy9ArIWEe00qy0_I/https%3A%2F%2Fgithub.com%2Fmars0i%2Fpasta%2Fblob%2Fmaster%2Fsrc%2Fclj%2Fpasta%2Fsnipe.clj

(Warning: I have had to get more into Clojure macro-ology than is healthy for human beings.)


On Apr 3, 2019, at 1:44 PM, Robert Zupko <[log in to unmask]<mailto:[log in to unmask]>> wrote:

Marshall:

You using MASON via the Clojure Java Interop that's built-in, correct?

Regards,
Robert Zupko

On Tue, Apr 2, 2019 at 10:57 PM Abrams, Marshall <[log in to unmask]<mailto:[log in to unmask]>> wrote:
In one of my models, I implement the interface Propertied, returning a Properties object.  This allows me to use inpectors with agents each of which is implemented by a series of objects one at a time.  I can then double-click on an agent in the GUI and see the field values of the agent change as the simulation progresses, even though there is actually a different object containing the data in each time step.

To subclass Properties I'm supposed to have a getDescription method, but the returned strings don't seem to be used.  getDescription is called when I inspect an agent--if I stick print statements in it, they fire--but I don't see any other effect of this method.  The manual mentions there will be popup tooltips, but this is in a different context, where one is defining bean properties directly and defines a desXyz method to return a string description.

It's conceivable that something is getting messed up because of a conflict between Clojure's and MASON's assumptions; I use MASON with Clojure rather than Java.   There is another case in which I'm pretty sure that Clojure is getting confused by MASON, but it's not important, and I haven't though it worth trying to ask for help.  However, I don't think this is a Clojure issue, because I don't see tooltips on any of the built-in sample models I've looked at, either (but I have only checked a few).

Should I be seeing tooltips over the field names when I inspect an agent?  If this is not supposed to work, that's no problem for me.  It would be slightly more convenient to skip providing a distinct description for each field, so if the descriptions aren't going to be used anyway, I can make getDescription return an empty string in all cases.

Thanks much-

Marshall


Marshall Abrams, Associate Professor
Department of Philosophy, University of Alabama at Birmingham
Email: [log in to unmask]<mailto:[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/1rV6iylFZiBC-WqzG77LxIT35pfljV_ssCpINXgpkImpFujhpoiVYY0LOXSGRyMrx18CyIzQA2ywbt0FdyfqQnb53bzVLnnJ7UwCjesap2pdL_lvMPhwmbHT2hGuknYEoC7JgGSDtgpNJ3wrTYAnQkiicVP0Fz7FVSazsZQIV1JYveRkIjpwd52DvDXImP-_7r0tgx3eXhOaGXKXz06J0jrEqrEKHYLyVMpv0n89MOBU_2FVAsJ0ZZk1AWE8shCKfgXYdRvNmBONCe4WA96b8pdZ6dNXVzu6z7phHUQ-T56OplcKXykQichahUoVU611PKch_jyDGDbKC2ba4potYvuXjyFRXXnKSl7HkKMrg-YFqOtlAfq3G7_GyhrXiJ2Cmx0zDIXFSI9tGZznfwfvZk4jNPY0dGL5l_MyRTz-CRBU/http%3A%2F%2Fmembers.logical.net%2F%7Emarshall<http://secure-web.cisco.com/1pHfVLSyxsJ3lvpIKC1MQUmv9DFyqdrnY1wJ1dufQrWv5D70g7CDTkpuhuKnE47jdvwpoSsQvMICjqK86gFXxDPu-fW2q8MPuV4q8cW4OqmZVuwLb5ft-N8XTetY3aiP8E9CsLIV7YziNAkc16Sx-vg2XhoGosjl4R1HdDU6jAt2hmn1Bo_s_y0c5KD7jp0h7SfYkz8v0wIWp0MflbrxiYpeTIckbgAN1s_dzvrDDM_CmK3P9x085iEPFwxBZCrRXxOXIne_c2NebZZ2GjcPQMcxpd5Ismcpg5fziilukT_inIQKLAhx-S92VV80fPDp4aFQKBl2xhxa2sP9m6wjTmilGT_4snzVxiok6cepgn0qJxAKEDc7GBEIIi1V7tXV2YxQ6fvvzie2BXD-ncImGqVwanXakFOeLqR5hG3VEY_h3HCsG4j38AnQekpQ3KS2Py4cOW94lRWJ1BxjzjmX1BA/http%3A%2F%2Fmembers.logical.net%2F%7Emarshall>