dscotthunter / Fantasy-Hockey-IP-Code

Other
104 stars 76 forks source link

Dimension Mismatch #5

Open Croftc opened 6 years ago

Croftc commented 6 years ago

I am successfully able to run all provided formulations on the provided test data, but running on actual data, formulations 3 and 4 don't work - specifically the defensemen stacking constraint. The error I receive states:

glp_intopt: optimal basis to initial LP relaxation not provided WARNING: Not solved to optimality, status: Infeasible WARNING: Infeasibility ray (Farkas proof) not available ERROR: LoadError: DimensionMismatch("mismatch in dimension 1 (expected 1 got 217)")

jcameronmetz commented 5 years ago

Did you ever get this working I'm having the same issue? The (Array{Int64,0})[] was a big fix

jcameronmetz commented 5 years ago

This was also given : DimensionMismatch("mismatch in dimension 1 (expected 1 got 360)")

trbradle44 commented 5 years ago

make sure you have the teams/opponents laid out correctly. for example: team A with opp team B, & team B with opp team A; NOT, team A with opp team B, & team B with opp team C

hope that helps.

On Fri, Oct 19, 2018 at 11:01 AM jcameronmetz notifications@github.com wrote:

This was also given : DimensionMismatch("mismatch in dimension 1 (expected 1 got 360)")

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/issues/5#issuecomment-431413092, or mute the thread https://github.com/notifications/unsubscribe-auth/AWGsJX36RtaqwCUCQGcyoUbHo3RKZrZjks5umfdmgaJpZM4SrKrm .

shane-rand commented 5 years ago

Any luck on this? I'm running into the same error and I verified teams and opponents matching up.

jcameronmetz commented 5 years ago

Yep- I'll respond this weekend at some point

On Fri, Dec 14, 2018 at 5:28 PM Shane Rand notifications@github.com wrote:

Any luck on this? I'm running into the same error and I verified teams and opponents matching up.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/issues/5#issuecomment-447497934, or mute the thread https://github.com/notifications/unsubscribe-auth/AqIaQwNCFuWF3FsPFOHslB_ZeLh9ElMxks5u5CYVgaJpZM4SrKrm .

shane-rand commented 5 years ago

@jcameronmetz Can you let me know how you fixed this?

jcameronmetz commented 5 years ago

@constraint needs to be changed

@variable needs changed

Those are the things that helped work for me.

jcameronmetz commented 5 years ago

Variable for skaters in lineup.

@defVar(m, skaters_lineup[i=1:num_skaters], Bin)   -> change this to @variable

# Variable for goalie in lineup.
@defVar(m, goalies_lineup[i=1:num_goalies], Bin)

# One goalie constraint
@addConstraint(m, sum{goalies_lineup[i], i=1:num_goalies} == 1)  change this to @constraint
shane-rand commented 5 years ago

@jcameronmetz Hmm, unfortunately I already had those fixes in my code. Still experiencing the issue. I believe since the model is not being solved, its throwing the error on the next lineup creation.

The example data works perfectly, leading me to believe I've set up my data wrong? If you could send over your last data file that worked (both skaters.csv and goalies.csv) that would be appreciated.

shane-rand commented 5 years ago

Still working on this....

I've found that its the 'at least one full line' and 'defenseman on powerplay one' constraints that are the problem. Currently trying to decipher those constraints...

jcameronmetz commented 5 years ago

Yeah - making your lines correct isnkey - try running a report against your lines to make sure you have complete lines

On Tue, Dec 18, 2018 at 10:31 AM Shane Rand notifications@github.com wrote:

Still working on this....

I've found that its the 'at least one full line' and 'defenseman on powerplay one' constraints that are the problem. Currently trying to decipher those constraints...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/issues/5#issuecomment-448260640, or mute the thread https://github.com/notifications/unsubscribe-auth/AqIaQz9IN_3mQg3Aqz01kXaNetvybmxzks5u6QpMgaJpZM4SrKrm .

shane-rand commented 5 years ago

Finally figured it out.

https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/blob/673b0a5119ed746a8dc2347206d138c84407def1/code_for_Github.jl#L736-L799

These lines are using double quotes around the line numbers for comparison. I removed the quotes and compared as a number and everything worked swimmingly.

awiden91 commented 4 years ago

@shane-rand Hey, could you please send over the full code that you used to get it running? I am having trouble updating it and keep running into a LoadError: UndefVarError: i not defined error. Would you be able to help me with this. Thank you and I appreciate your time!

mhbw commented 1 year ago

@awiden91 also hitting the "I not defined" issue; did you ever solve it?