Jump to content

Today in homework


mcdoga
 Share

Recommended Posts

Hey, SF! I think we should share what homework we have each night so we can learn more about others experiences (read: pain). Tonight, I had to make a postcard about Costa Rica for Spanish. I drew little blue butterflies on it.

Link to comment
Share on other sites

It wasn't really homework, but I drew random shapes all over my Geometry worksheet (coincidentally), and I ended up turning a circle I drew into the face of my crush. My friend in front of my turned around and looked really confused at what I drew, but she said she liked the face!

Link to comment
Share on other sites

I have to write a post connecting something in educational psychology to my interning experiences and work on a Japanese speech

Link to comment
Share on other sites

No uni plans, then?

No im going to college BC by not doing my homework I jst get low Bs instead of As since im not failing my tests or anything and my old grades are As so it's not hurting my GPA too much

Link to comment
Share on other sites

No im going to college BC by not doing my homework I jst get low Bs instead of As since im not failing my tests or anything and my old grades are As so it's not hurting my GPA too much

Alright, but fair warning - you are going to be fucking destroyed in university if you don't do your set readings there. It's easier to get into good habits before you're in a make-or-break situation.

Link to comment
Share on other sites

# runtime parameters:

# RCLSize determines how many nearest neighbors will be selected from at each stage of initial solution construction

# iterations determines how many independent trials will be run

# globalBest is an arbitrarily large number so it will be immediately replaced

RCLSize <- 3

iterations <- 10

globalBestSolutionObj <- 1000000

for(k in 1:iterations){

noOpt <- 0

# construct an initial solution starting from a random point

currentSolution <- sample(1:arrayLength,1)

for(i in 1:(arrayLength-1)){

RCL <- CreateRCL(namedDistance, currentSolution, RCLSize)

if(length(RCL) >= RCLSize){

currentSolution <- as.numeric(c(currentSolution,RCL[sample(1:RCLSize,1)]))

}else{

currentSolution <- as.numeric(c(currentSolution,RCL[sample(1:length(RCL))]))

}

}

currentSolutionObj <- EvaluateSolution(distanceMatrix, currentSolution)

bestTrialSolutionObj <- currentSolutionObj

# 2optimize the GRASPed solution

while(noOpt != 1){

for(i in 1:(arrayLength-1)){

for(j in (i+1):arrayLength){

trialSolution <- currentSolution

trialSolution <- currentSolution[j]

trialSolution[j] <- currentSolution

# evaluate two arc swaps; four total operations

if(i==1 && j == arrayLength){trialSolutionObj <- currentSolutionObj -

distanceMatrix[trialSolution[2], trialSolution[j]] -

distanceMatrix[trialSolution[j-1], trialSolution] +

distanceMatrix[trialSolution[2], trialSolution[1]] +

distanceMatrix[trialSolution[j-1], trialSolution[j]]

}else{

trialSolutionObj <- currentSolutionObj -

distanceMatrix[trialSolution[if(i==1) arrayLength else (i-1)], trialSolution[j]] -

distanceMatrix[trialSolution[if(j==arrayLength) 1 else (j+1)], trialSolution] +

distanceMatrix[trialSolution[if(i==1) arrayLength else (i-1)], trialSolution] +

distanceMatrix[trialSolution[if(j==arrayLength) 1 else (j+1)], trialSolution[j]]

}

# replace the 2opt incumbent only if the challenger is better

if(trialSolutionObj < bestTrialSolutionObj){

# swap the nodes in between to preserve the arcs

if((j-i)!=1 && (i != 1 || j != arrayLength)){

trialSolution.temp <- rev(trialSolution[(i+1):(j-1)])

trialSolution[(i+1):(j-1)] <- trialSolution.temp

}

# error-checking code commented out

#if(round(trialSolutionObj,4)!=round(EvaluateSolution(distanceMatrix,trialSolution),4)) stop()

bestTrialSolution <- trialSolution

bestTrialSolutionObj <- trialSolutionObj

}

}

}

# check if the 2opt solution is better than the incumbent; if not, flag to abort

if(bestTrialSolutionObj < currentSolutionObj){

currentSolution <- bestTrialSolution

currentSolutionObj <- bestTrialSolutionObj

}else{

noOpt <- 1

}

}

# check if the current solution is better than the best solution found by GRASP so far

if(currentSolutionObj < globalBestSolutionObj){

globalBestSolution <- currentSolution

globalBestSolutionObj <- currentSolutionObj

}

# this brace ends the current iteration

}

#Rprof(NULL)

suteki da ne

it's a GRASP algorithm to solve a traveling salesman problem.

Edited by Integrity
Link to comment
Share on other sites

No im going to college BC by not doing my homework I jst get low Bs instead of As since im not failing my tests or anything and my old grades are As so it's not hurting my GPA too much

you're going to be fucked in college, mate

Link to comment
Share on other sites

Alright, but fair warning - you are going to be fucking destroyed in university if you don't do your set readings there. It's easier to get into good habits before you're in a make-or-break situation.

I know im not usually like this ive just been tired this year <:

Link to comment
Share on other sites

you're going to be fucked in college, mate

tbf the line bw hw and studying is substantially blurred here. some lectures are also the usual 30-30-40 grading systems with the three midterms, but ofc depending on majors and all. in my experience, the physics, bios and chems are sometimes like that. shoutout to that one bio class i had that was 33-33-33 and 1 point for clickers

Link to comment
Share on other sites

like two weeks of diary entries in arabic orz

very jealous. my school hasn't offered arabic in nearly 10 years. i have a textbook but no time.

as for homework, about 10 min ago i finished my lab report on the column density of hydrogen at the edge of the galaxy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...