Hello everyone!
I’m reaching out to know how can I use multiselect in showing nodes and arcs in my network map. It is part of my project to make the UI interactive, however, I’m having difficulty doing so.
I have tried testing if the same multiselect-table interaction can also work here, but it doesn’t.
Any tips or examples you can provide?
Thank you!
Hello ccfcuento,
I created a small WebUI application, illustrating how I use the multi-select widget to make selections and work with these selections in other widgets.
To start with the app has:
- A set of locations, s_locs with indices i_loc, i_locFrom, i_locTo.
- A parameter with data between those locations, p_dist(i_locFrom,i_locTo) (random data, not actual distances).
- Latitude and longitude info for each location p_lat, plon.
- A table widget showing data between those locations
- A Map widget showing the locations (three locations in the south of South America).
To adapt this app for location selection, I made the following steps:
- I introduced a binary parameter, bp_locSel(i_loc) and initialize it to 1 for each location.
- I placed that on a new multi-select widget thus permitting easy selection / de-selection of a location.
- I introduced a subset of locations, s_selLocs, defined as { i_loc | bp_locSelec(i_loc) }, and with indices i_selLoc, i_selLocFrom, i_selLocTo
- In the map widget, each of the parameters used, I changed the index from i_loc to i_selLoc thus showing only the nodes in the set s_selLoc.
- In the table widget, I changed the use of index i_locFrom to i_selLocFrom, and i_locTo to i_selLocTo.
I hope this example will enable you to apply selection to your application as well.
With kind regards,
Chris.
PS. The filter tab is no longer available to widgets, see also the first remark in: https://documentation.aimms.com/webui/widget-options.html#widget-options
Hello Chris,
Thank you very much for this. I will try working out on your steps.
However, just to give you a heads up, I cannot seem to access your file and the program says:
Thank you again!
Hello Carl,
This UUID refers to the WebUI library as a repository library; and this is in use since AIMMS 24.4.
My example is based on AIMMS 24.5.
You can download and install AIMMS 24.5 from aimms.com/downloads.
With kind regards,
Chris.
Hello Chris,
Does that also work for academic licenses? Thank you!
Dear Carl,
It works the same no matter the license type so it should work for an academic license as well.
Kind regards,
Dessie
Hello,
Thank you again and apologies for the numerous questions.
I have already tried it but it does not work the same way. It is because I don’t need to include distances between the nodes, instead, only the coordinates are important. However, I don’t know how will I change the index of the coordinates based on the selected one.
Thank you again.
If I proceed with making another index for selected nodes and put it as index for the subset, AIMMS shows this error message:
The declaration of index "selectedI" cannot be changed from a stand alone one to a local one.
Also, I tried the slicing index to the selected_I index I made but the UI says this error:
Hello, kindly disregard the previous inquiries. I already did it.
Additional question: How about if I want arcs to be activated thru multiselect. Is that possible?
Hello ccfcuento,
There are actually three answers to your question.
Let's start with the first one - yes the multi select on nodes can be used to select the arcs as well.
The data in my example is symmetric, but in the map widget it should be shown only once. This is why I defined the upper half as follows:
p_distH(i_locFrom, i_locTo) = p_dist(i_locFrom, i_locTo) | ord(i_locFrom) > ord(i_locTo) and use this to define the arc data shown in the map.
The arc selection now uses p_distH, with index selection i_selLocFrom, i_selLocTo - just like the distance table in my previous answer.
The Map widget then looks as follows:
and as follows
With kind regards,
Chris
Hello ccfcuento,
The second answer on arc selection builds on the first answer.
An additional table is introduces that acts as a selection widget.
We introduce a binary parameter, bp_selectArc(i_locFrom, i_locTo)
We adapt the parameter to be displayed to bp_shownArcs(i_locFrom, i_locTo) defined as
if bp_arcSelect(i_locFrom, i_locTo) then p_distH(i_locFrom, i_locTo) else 0 endif
This results in the following screen:
With kind regards,
Chris
My third and last answer builds upon my second answer.
The difference is now that the arcs are named, and can individually be turned on / off. This eases studying networks whereby one or more named arcs are disabled.
The running example is extended with a three arcs, representing scenic routes: mountainView, seaView, and lakeView. For each of these named arcs, the from and to node are defined.
The following table illustrates the end user view:
To implement this, changes in the data for bp_arcSelect1(i_arc) needs to be propagated to the bp_arcSelect(i_locFrom, i_locTo). To facilitate such changes, uponchange procedures can be annotated to the identifier that is being modified by the end-user.
With kind regards,
Chris.
Reply
Sign up
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.