I am trying to get Data of 2 different ObservableLists in one TableView (2 Colums), but havnt found a solution for now.
I got 2 Lists, each holding elements of a special DataType.
I need 2 get Parameter Name out of Datatype A in OL1 und Parameter zone of Datatype B in OL2.
A and B are both SimpleStringProperty.
ObservableList 1 und 2 always got the same length.
I know i can get the parameters out of the lists with PropertyValueFactory, but i cannot use different sources.
Is there a hint u can give me?
Related
I am trying to solve an assignment problem in excel but cannot achieve it yet. As you can see below I need to assign some jobs to some people. I have to do this by some rules;
1-Each assignment counts one and this adds on point cell. (aa has 2 points if I give it another job aa's new point became 3 points)
2-It is great if points are not bigger than 6.
3-If it is possible type 1 and type 2 must match. If it is not, any type2 can fit any type1.
I need to fill C and D (if job count is 2) with names column with considering type columns and point column. Can you please help me?
I know this is not the first time someone is asking a similar question, but me trying to execute what I found out in other answers is not working exactly as how I want it to be. I hope someone here could help me.
I got four columns, the first one is the Product Name, and the last one is its P/L%. I want to sort out top and bottom 5 P/L% value along with their corresponding Product Name. I am attaching the screenshot of a sample scenario in case if you couldn't understand what I explained.
I tried the (sort(filter)) method as found somewhere else, but it actually messed up with the second and third columns. I hope someone here can give me some simple ways.
My solution considers the case when multiple products has same value in P/L% and I use a Table object for displayed data.
Formulas to use
Top 5 Gainers values
=LARGE(ProductTable[P/L%]; ROWS($H$3:H3)), and copy down
Top 5 Gainer values
Top 5 Gainers products name
=INDEX(ProductTable[Product Name];AGGREGATE(14;6;(ROW(ProductTable[P/L%])-ROW(D$2)+1)/(ProductTable[P/L%]=H3);COUNTIF($H$3:H3;H3))), and copy down
Top 5 Gainers products name
Top 5 Loosers values
=SMALL(ProductTable[P/L%];ROWS($H$3:H3)), and copy down
Top 5 Loosers values
Top 5 Loosers products name
=INDEX(ProductTable[Product Name];AGGREGATE(14;6;(ROW(ProductTable[P/L%])-ROW(D$2)+1)/(ProductTable[P/L%]=K3);COUNTIF($K$3:K3;K3))), and copy down
Top 5 Loosers products name
Short Explanation
You must use LARGE and SMALL functions when you want to get the largest or the smallest value in a data array.
AGGREGATE function is a little bit complex to explain here so I recommend you this link to understand better. Basically, I use this formula to get the row of the gainer or looser product name into INDEX function.
ROWS($H$3:H3) returns 1, but when you copy down this formula, you get 2, 3, and so on. This is a nice way to expand the query if you need more than top 5 values.
Similar problem in:
https://www.excelforum.com/excel-formulas-and-functions/1208726-index-match-large-and-duplicates.html
I am willing to use a 3D parameter on my LP project. However, I cannot read the parameter's data in a proper way.
Is it possible to get the data by using Excel or by writing the parameter's values in matrix form at .dat file. Also, other potential solutions can be helpful.
float rt[B][P][Z]=...; //Response time of boat type b at port p to zone z
well, a 3dim array is for all compbination of the 3 indeces, and excel is a 2dim table format, so on the way you started writing things you can't read a 3dim array from excel directly. Does the 3dim means that indeed you need all combinations, or some. If the later then if B/P/Z exist for some combinations, then you could use a tuple format for the triplets...
the declaration of the tuple type is something like
tuple BPZ {int B;
float P;
float Z};
then you declare the data with this type like
{BPZ} myData = ...;
and then in the excel you have 1 table with all the triplets.
if the first (all compbinations have data), then the other way is to make each PZ 2dim arrays/table/matrix in excel B times... tedious, but doable if you don't create the data manually but programmatically = in Python you can use openpyxl (https://openpyxl.readthedocs.io/en/stable/ - I've used it, it's quite good/straightforward) and then DOOPL to get the OPL/Python together (https://developer.ibm.com/docloud/blog/2018/09/26/opl-and-python/ + https://pypi.org/project/doopl/). you could use the triplets/tuple in any case, when all combinations are present but then it might be a lot of value, so it depends on the size of BPZ how you want to go...
I have a large data frame that I need to subset based on a character string of row indices provided in a single column within another table (from outside of R). These strings include several styles of index (e.g. c(1,3), c(1:10,15), 3:10, but all are formats that should be acceptable to R. I've provided a small example here, but in practice the indices typically refer to large row chunks within a very large data frame, so I'm keen to stick with this approach if possible.
Example data:
my.df<-data.frame(group=c("a","a","b","b","c","c"),value=c(1,5,5,15,20,3))
set1<-"c(1,3)"
set2<-"c(1:3,5)"
what I'd like:
my.df[set1,]
group value
1 a 1
3 b 5
my.df[set2,]
group value
1 a 1
2 a 5
3 b 5
I can read the index strings into R successfully and convert them to a form that looks right as per the code above, but haven't been successful with the subsetting. I'm sure there's an easy trick so any help is much appreciated.
Something like this maybe
my.df[eval(parse(text=set1)),]
I am making a space invaders game. Each invader has its position on the screen stored. This would form a nice grid of 5 rows with each 11 invaders.
There are 3 types of invader A, B, and C. A consists of 22 invaders, B also, and C 11. Because of this I could not use their positions alone to form the grid on the screen. So, I added variables for how many rows and columns there are and with these I could use a nested for loop to get the right amount of invadertypes.
Now, I have an idea for some kind of algorithm to get them to do something, but for that I need to store them in a certain way. How I'm thinking of doing it is to use a Dictionary<int, Tuple<Point, Invader>>, where int will be the index like in a list, Point will be used for storing row-column, and Invader for well, the invader.
Before I used a List to store invaders and so I could with a for loop access the invader I needed to perform an operation on. Like invaders[i].DoSomething().
I want to be able to still do that, and have not only the invader, but also what row-column it is occupying.
What are my options?
Why not add row / column variables to your invader class?