import java.util.ArrayList;
import java.util.Random;
import java.util.*;
public class Process
{
//5 process states
final static int NEW = 0;
final static int READY = 1;
final static int RUNNING = 2;
final static int WAITING = 3;
final static int EXITING = 4;
//header info
int stackSize;
int programCounter;
int processSize;
int burstTime;
int remainingTime;
int numRequested;
int IOTime;
int waitTime = 0;
int TurnAround;
int pageTable [];
ArrayList<Resource> requestedDevices = new ArrayList<Resource>();
ArrayList<Resource> allocatedDevices = new ArrayList<Resource>();
Random rand = new Random();
final int maxSize=4096*(2^10), minSize=4096*1, maxDevices=5, minBurst=1, maxBurst=8; //change these to whatever is needed
//constructor creates a process with random values
public Process()
{
processSize = rand.nextInt(maxSize-minSize)+minSize; //random process size between min and max
pageTable = new int [(processSize/4096) + 1];
numRequested = rand.nextInt(maxDevices);
//for (int i=0;i<numRequested;i++){ //set some random devices to be requested
requestedDevices.add() .getResource("Resource.java");
//}
IOTime = requestedDevices.get(0).getTime();
burstTime = rand.nextInt(maxBurst-minBurst)+minBurst + requestedDevices.get(0).getTime(); //random burst time between min and max
remainingTime = burstTime;
}
//this method acts as the loader and creates a PCB for a process
public PCB loader(int pid, int entryTime)
{
return (new PCB(pid, entryTime));
}
}
the compiler returns an error saying:
./Process.java:41: cannot find symbol
symbol : method add()
location: class java.util.ArrayList<Resource>
requestedDevices.add() .getResource("Resource.java");
I believe I need to define the method add but don't how or if this will work???