So I'm trying to make a program that can solve the travelling salesman problem, and so far I've managed to represent my scenario in a matrix. In this matrix, I've made objects of a distance class, which would represent the edges of my graph. I want to use the drawLine method, and it compiles fine, but it's not doing anything. I've imported java.awt.Color, set the drawing colour, etc, etc, no progress. Anyone able to help please?
public class Distance extends Actor { int _x1; int _y1; int _x2; int _y2; int _distance; GreenfootImage GFI = new GreenfootImage(1280,720); public Distance(int x1, int y1, int x2, int y2, int distance) { _x1 = x1; _y1 = y1; _x2 = x2; _y2 = y2; _distance = distance; GFI.setColor(Color.BLACK); GFI.drawLine(_x1, _y1, _x2, _y2); } }