Linking sliders in Netlogo so their cumulative value always remains 100% or less - netlogo

I looked but could not locate any Netlogo code that links a set of sliders that, as one increases in value the other sliders decrease so the total value never exceeds 100% (even though the total can be less than 100%). Has anyone ever tried this?
Thanks
Rudy

You could implement it with something like an 'Update sliders' button, where you set the values you want for all the variables, then press the button and that calls a procedure to adjust them all so they add to no more than 100%. But sliders adjust either because the user adjusts them, or the NetLogo code says something like set variable-name new-value and that code is called in some way.
In practice, if I have multiple sliders that I don't want the total to exceed something, then I have a line at the start of the go procedure that checks the total and stops with a message if it's too high.

Related

Netlogo, Altering the location of label

I am just curious if it's possible to alter the location of the labels in NetLogo. For example in the image below the word "La Grande Soufriere", is it possible to move it above the breed instead of below (as you can see it gets in the way of the other agents. Another case is the Habitants PMA (Actual name is Vieux Habitants) but only half of its name has appeared since the rest of its off-screen. I tried to manually type on a close-by patch but since I have used a fill color, it doesn't appear at all (it's covered by the fill color if you know what I mean). Does anyone have a solution for this?
I am just curious if it's possible to alter the location of the labels in NetLogo.
The short answer is that it is not possible.
The slightly longer answer is that there are ways around it, but they're not very satisfying.
If you want to alter the horizontal location, you can pad your label with spaces at the end or the beginning of the string to move it left or right, respectively.
If you want to alter the vertical location, or have more control over it, you can always create a "dummy" turtle to display the label. You can hide the dummy turtle without hidding its label by setting the size of the turtle to zero or by creating an empty turtle shape and using that for it.
I don't think it matters in your case, since you seem to want to label only stationary turtles, but if you wanted a dummy to move with a particular turtle, you can create a hidden link between them and tie them.
There might be other creative ways to deal with labels (and I'd be curious to read about them in other answers), but that's all I can think of for now.

tableau adjust marks size using number

In Marks, click Size and there pops a slider where I can adjust the size of a shape. But how to accurately control the size, is there some property with numbers to accurately control it? I have two sheets to show something similar and I want to display exactly the same sized shapes.
If you want to ensure 'sizes' are the same across two worksheets, I'd suggest snapping the 'size' setting to the center on both, as this is the easiest option to select. You can then use a measure to set the size, if this is desirable, and then the difference in size will be relative on both worksheets.
There isn't a numerical value override for the size slider.
Ben is correct, there isn't yet a numerical value override for the slider. You can use parameters with Min/Max/Sum etc. and a variable to somewhat change the sizes but they have to have multiple entries per line. It is unfortunate that Tableau still doesn't get that people want both a 'relative' sizing system that uses numbers from the dataset and a 'static' sizing system that allows for shapes to be set to '11px' or something along those lines. Yes, you can control that kind of in the dashboard with a vertical and fill entire box etc; but that doesn't address the very real scenario where you want a user to be able to re-size on the fly. Just my two cents.
I ran into this today. Very annoying. Need to keep shapes the same size across all worksheets and therefore same on dashboard.

How do I display the total percentage and count together as a stacked bar chart without formatting all data to percentage values?

I asked this question (and this question) recently, and even though both have solutions, I am left with a new dilemma because each solution only works on an independent level (i.e. one solution won't work if the other solution is in place).
The problem is this: In Tableau, I discovered that by opting to display the data as a percentage of the total row value Analysis > Percentage of > Row, it resulted in the count value also being displayed as a number between 0 and 1 (i.e. percentage format, because of the aforementioned percentage-only setting).
Is there a way to achieve a 100.00% stacked bar which shows both percentage AND count, and which also isn't formatted to display all data as a percentage of the row total?
The screenshot shows what happens when both solutions are in place. Original screenshots are available within the body of each of the previous questions.
Note: I feel that the right way to go about it might be to normalise my data (bringing all values to a scale between 0 and 1), but being new to Tableau, I am not sure how this is achieved. If this is correct, I would appreciate a walkthrough.
Right click on the second SUM({Number of Records]) pill on the Label shelf, and clear the table calc. Edit your label if needed

Slider settings for GPUImage

I'm making an app which allows the user to apply GPUImage filters to still photos using a UISlider. I'd like for the slider to initially start at the zero point for each filter (i.e. the value at which none of the filter has been applied yet) and I'm wondering how this can be determined? I've used some of the values that are listed in the GPUImage documentation and for certain sliders they start at 0, but others it's hard to determine (and for some, the min and max values are way off for me). The values for something like GPUImagePosterizeFilter seem to be way off for me (set min to 1, max to 128 and initial to 1). I've also checked some of the values in the FilterShowcase test project which are different than the documentation, but still don't always start at 0. Am I just completely missing the point here? Or is there some setting I maybe have to turn on to be in line with the slider values?
Nope, no setting for this. All I can really recommend is that to make this as efficient as possible make a switch statement in a single method and determine what to do by index of the currently selected filter.
From there, I would leave the min/max values of the slider the same so that you don't have to animate from one calculated point to another if the filter changes and mathematically convert the slider's value into units that the current filter understands. i.e. 0-1 --> 1-128
I think I might have been approaching this the wrong way. Rather than looking for a "zero point" on a filter, I think I should focus on applying the filter only when the user applies it, and trying to find a good starting point that is close to how the image looks without the filter for the initial value on the slider.

Is it possible to determine the current rendering position in Crystal Reports?

i would like to create a conditional keeptogether property depending on the space left on the current page, is it possible to get this value from within a formula field?
my goal is a visual clean report without wasting to much space, i already read about a method where you keep track of your position with a linenumber counter. unfortunately i cant use this approach because my lines vary heavy in height because of a note field which holds from 0 to 25 lines.
This is going to sound like a ridiculous and tedious suggestion, but it's the only way I know of making this work. You'll need to use that process of line counting (basically, keeping a running total of how many lines have been printed) that you heard of with one modification: calculate the number of lines Notes needs by the getting the length of that Notes string and dividing by a pre-determined count, which you'll need to do visually, of how many characters are in a line and make the result the line's line count in the overall formula. It's not going to be exactly right because there is no way to make it exactly right, but it will be close. Does that makes sense or do you need me to go into exact detail of how to do this?