1. Hello and welcome to the brand new home for PlayDota!
    Please read through our Welcome thread to see what's new!
    Dismiss Notice

Multi-D tables?

Discussion in 'Tech & Programming' started by mapdesigner, May 14, 2017.

  1. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    Hello,

    I have quantity that is a function of 4-5 arbitrary variables (they may or may not depend on each other).

    what is the best way to represent this? I kinda like to use excel spread sheets to represent 2-D tables but dont know if in this case it is possible.

    thoughts? (obviously I do not want to create multiple spread sheets manually, but prolly multi-D array would work, wouldnt it?)
     
    Last edited: May 15, 2017
  2. slipkwar

    slipkwar Member

    1,492
    97
    48
    Dec 11, 2009
    "I have quantity that is a function of 4-5 arbitrary variables"
    Is is a lineal function? Forget it, wrong question.

    Can't you write the whole expression in one line?
     
    Last edited: May 15, 2017
  3. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    no

    it involves armor function something like (ax+1)/(b+c)
     
  4. slipkwar

    slipkwar Member

    1,492
    97
    48
    Dec 11, 2009
    Is it for Excel or you are writing a program?

    For Excel you can write in one cell "1", in the next "2", select both, and drag from the corner to create a list of cells with 1,2,3...

    For a program you should use a for loop.
     
  5. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    but can excep make it for 4-5 variables? how? a x b c all changing it can do that?
     
  6. slipkwar

    slipkwar Member

    1,492
    97
    48
    Dec 11, 2009
    [​IMG]
    You will have to create an a,x,b, and c columns. You can choose the "jumps" in the numbers. A does 1 to 1 jumps from the number 50.
     
  7. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    nah

    this is not good enough because variables are independant. for A=1, I need b to take value from 1 to 99. and for b= 1 I need c to go from 1 to 99

    its kind of like this picture
    [​IMG]

    but this picture it has only 2 variables. now I want to introduce new dimension witch varries independatly.

    you can see that Armor reduction (the horizental) is separated from unit armor (the vertical) and is independant.

    for each value of armor, I can find the needed function for different reductions. its a table, not 1 line.

    so
    -1 -2 -3
    1
    2
    3
    works

    but
    -1 , 1
    -2 , 2
    -3 , 3
    is not good enough because it does not calculated for other values (if reduction is -1 and armor is 3)
     
  8. slipkwar

    slipkwar Member

    1,492
    97
    48
    Dec 11, 2009
    Did you try to use some function grapher? Put 2 variables as constants and the other 2 as variable
     
  9. Blarrg

    Blarrg Member

    10,232
    292
    83
    Jun 12, 2009
    Can you write out exactly what you want to do? Do you want to do some kind of math on each row and put it in another column??

    Example on a row: (A1+B1/C1) = Z1 (where Z is a new column)

    Right now your explanation is not very clear. I'm also pretty sure what you're trying to do is easily replicable with a simple python script if you know any programming languages.

    For example, you could export that spreadsheet as a csv, load the csv into memory for a python script, do whatever you want to the data structure and write it out to a new csv that could be imported as an excel spreadsheet.
     
  10. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    One minute i can do it
     
  11. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    TLDR:
    It is just 1 quantity as a function of 4 independent variables and 1 dependent variable

    Quantity needed = {(K X Rm1 + f(A1))}/{(K X Rm2 + f(A1+Abonus)}

    Rm1 Rm2 is same variable (like z1 z2 )
    K is arbitrary ratio from 0 to infinity
    A1 is arbt.
    Abonus is also Arbtr. (A1 is like X1 and Abonus is like Δx which is arbitrary and we choose it)

    so variables can be listed as:
    Rm1, Rm2, A1, Abonus, K

    in 3-d space value of X, Y, Z are independant and any function will be f(x,y,z): but they are not in the same axis: similarly I want 5 axis of Rm1 Rm2 A1 Ab and K in 5 different axis so I can plug in formula and represent data.

    TRUE VERSION
     
    Last edited: May 16, 2017
  12. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    well I guess it is not impossible to code it with matlab or anything (I still dont know python) but I thought I dont know how to represent it. I wanted some readable data, and see maxima and minima and also see how it changes

    btw does my prev. post make any sense on what I need to do?
     
  13. Blarrg

    Blarrg Member

    10,232
    292
    83
    Jun 12, 2009
    You won't be able to make more than 2 dimensions of data in an excel spreadsheet.
     
  14. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    so basically its not really possible to make such thing easily readable? (btw for excel i think only way is to do it on multiple sheets)

    I probably will have to select desirable range then
     
  15. Blarrg

    Blarrg Member

    10,232
    292
    83
    Jun 12, 2009
    Multiple sheets would give you 3-dimensional. I highly recommend downloading python and writing a script for your math. If you know the math you want I can help you with the coding.
     
  16. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    I havent tried to do it with matlab, but why would python be better? can it represent results more neatly? or it doesnt matter which one I use?
     
  17. Blarrg

    Blarrg Member

    10,232
    292
    83
    Jun 12, 2009
    You can output some of the results in a command prompt to make sure the code did what you wanted. Once you confirm that you can write the results you want to a csv (assuming you only care about the 2 of the dimensions and are using the rest to generate values). If you want to visualize more than 3 dimensions you'll have a tough time doing that with anything (including matlab).
     
    mapdesigner likes this.
  18. mapdesigner

    mapdesigner Member

    2,001
    92
    48
    Aug 11, 2011
    actually

    this is a good way to represent 3-D

    I cant beleive I didnt think of doing it. I actually have used such tricks before but you always forget when you need :D

    [​IMG]
     
  19. slipkwar

    slipkwar Member

    1,492
    97
    48
    Dec 11, 2009
    Excel?