Skip to main content

Daniel, Week 6

Pittsburgh is a beautiful city, at least the part I'm living in. The streets of my neighborhood, lined with stores, a mix of antique restaurants and contemporary fashion salons, feel so fresh, clean, and perhaps even a little romantic at dusk.

That's what I felt about my project when I finally created a working animation of my grid, minus the romantic part. I took Mr. Corica's suggestion on repeatedly drawing the graph during the algorithm's execution to simulate live animation. New versions of the graph would draw over previous versions so quickly that to the human eye, it would seem as if every iteration of my code's draw function only adds newer elements to the graph. To make this happen would, of course, also require a wait function that runs in between iterations, as otherwise only the final state of the graph would be observable. Javascript is a single-threaded language, so it doesn't offer a built-in sleep function that pauses the code without killing the entire browser. My first solution attempt was a sort-of self-loop, a loop that calls itself with a working timer in between iterations. However, the loop had to be hardcoded and I couldn't find a way to break out of it once A*'s termination requirement was met (either having reached the end state or having filled the entire graph without finding an end state). Luckily, my second solution worked. I used an asynchronous function, denoted by the keyword "async", to run the main function of my code. This allowed for a simple custom-made sleep function to work, called upon in the async function and preceded by the keyword "await". Once the timer problem was solved, I had a graph that could display any square dimension (limited only by runtime efficiency, 100 x 100 blocks gets a little slow), have any start and end blocks, a changeable weight to scale A*'s efficiency, and animated blocks of different colors flow through the graph to visualize the algorithm's execution.

The last thing needed was to actually chart the shortest path produced by the algorithm. My version of the algorithm does not actually keep track of the shortest path during its execution. Rather, it looks for the most optimal way to reach the end block in a non-linear fashion, meaning the algorithm might explore multiple different blocks across the graph at the same time. Since I did record all the blocks that the algorithm at one point deemed the lowest minimum value (closest to the end) in a boolean array, generating the shortest path simply required backtracking from the end block to the start block by repetitively finding the next adjacent block with a true value in the boolean array that is closest, of the previous block's neighbors, to the start.

After producing what is, in my opinion, a good looking animated graph with cool colors, I met with Dr. Likhachev again. For my remaining time at the lab, I will be working on creating the same animation feature for ARA*, an improved and more efficient version that Dr. Likhachev himself wrote years back.

Comments

  1. Sounds like you are making a breakthrough with your work! Will be interesting to see your results in the fall.

    ReplyDelete

Post a Comment

Popular posts from this blog

Evan Bradley, Week 3 at the Missouri Orthopaedic Institute

As mentioned in my previous blog, I have been awaiting ligament, menisci, and cartilage tissue from a canine or human knee joint for (interleukin) IL-1B tissue culture. IL-1B is an inflammatory cytokine that has been proven to increase rates of tissue degeneration and osteoarthritis development in the Thompson Lab. Dr. Stoker wants me to experiment with different types of knee tissues in a co-culture with varying levels of this cytokine to determine its effects on the entire knee joint. This co-culture uses an insert permeable to the media to separate the two tissue samples from physical contact, while allowing them to share the same media. This creates an extremely accurate model for knee tissues in their native environment due to their exposure to the same synovial fluid in the joint. This model would then be treated with the IL-1B and cultured for 21 days. During these 21 days, the media would be collected every three days for biomarker evaluation at the end of the stu...

Kylie Heering, Week 2 at the Goldstein Lab

We started off our week with a congratulatory acai bowl trip to celebrate Preston’s acceptance into a training grant program. Acai bowls in California top Playa Bowls (no question about it). From what I can tell, its a pretty huge honor to be recognized by this grant, but he’s really humble about it. On Monday, Preston and I decided that testing antibodies that have never been tested on prostate epithelial cells before would be a good objective for my first Western blot on my own. We needed to probe for ASCT2, a glutamine transporter, and GLS in order to determine if their corresponding antibodies are functional. Antibodies are crucial for Western blots because they bind to the protein of interest (POI), allowing for us to qualify its expression after imaging. As such, Preston wanted to make sure they worked by probing for ASCT2 and GLS on three different cell lines. Cell lines are commercially purchased human cells that have been immortalized (modified to grow indefinitely) by telome...

Daniel Cheng, In My Own Room

I had no idea that Pennsylvania is this wide. Within the first hour, my train had reached Philly. But to Pittsburgh, it took another seven. Even before I stepped foot into the Search-Based Planning Lab, I was waylaid by some anxious news. The PhD student assigned to be my mentor, Dhruv, texted me that he, Dr. Likhachev, and most of the lab would be out of town for the entire week. So that was that. Fortunately, it was my first week, the week to be spent learning new material, and Dhruv provided me with plenty to digest. I already had ROS (Robot Operating System) installed, so I looked towards the tutorials that ROS provided. I copied commands into my Linux laptop's terminal to run ROS features. I learned the basic structure of ROS: packages, services and clients, publishers and subscribers, messages, nodes, and topics (which nodes communicate messages over). There was one simple yet interesting program I came across in the tutorials called turtlesim, for which using only 2 comm...