+++ /dev/null
-#############################################################################
-# Makefile for building: planner
-# Generated by qmake (1.07a) (Qt 3.3.4) on: Mon May 9 12:42:54 2005
-# Project: src.pro
-# Template: app
-# Command: $(QMAKE) -o Makefile src.pro
-#############################################################################
-
-####### Compiler, tools and options
-
-CC = gcc
-CXX = g++
-LEX = flex
-YACC = yacc
-CFLAGS = -pipe -Wall -W -g
-CXXFLAGS = -pipe -Wall -W -g
-LEXFLAGS =
-YACCFLAGS= -d
-INCPATH = -I/usr/qt/3/mkspecs/linux-g++ -I. -I.
-LINK = g++
-LFLAGS =
-LIBS = $(SUBLIBS)
-AR = ar cqs
-RANLIB =
-MOC = $(QTDIR)/bin/moc
-UIC = $(QTDIR)/bin/uic
-QMAKE = qmake
-TAR = tar -cf
-GZIP = gzip -9f
-COPY = cp -f
-COPY_FILE= $(COPY)
-COPY_DIR = $(COPY) -r
-INSTALL_FILE= $(COPY_FILE)
-INSTALL_DIR = $(COPY_DIR)
-DEL_FILE = rm -f
-SYMLINK = ln -sf
-DEL_DIR = rmdir
-MOVE = mv -f
-CHK_DIR_EXISTS= test -d
-MKDIR = mkdir -p
-
-####### Output directory
-
-OBJECTS_DIR = ./
-
-####### Files
-
-HEADERS = action.h \
- node.h \
- planner.h
-SOURCES = action.cpp \
- main.cpp \
- node.cpp \
- planner.cpp
-OBJECTS = action.o \
- main.o \
- node.o \
- planner.o
-FORMS =
-UICDECLS =
-UICIMPLS =
-SRCMOC =
-OBJMOC =
-DIST = src.pro
-QMAKE_TARGET = planner
-DESTDIR =
-TARGET = planner
-
-first: all
-####### Implicit rules
-
-.SUFFIXES: .c .o .cpp .cc .cxx .C
-
-.cpp.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.cc.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.cxx.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.C.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.c.o:
- $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
-
-####### Build rules
-
-all: Makefile $(TARGET)
-
-$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
- $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
-
-mocables: $(SRCMOC)
-uicables: $(UICDECLS) $(UICIMPLS)
-
-$(MOC):
- ( cd $(QTDIR)/src/moc && $(MAKE) )
-
-Makefile: src.pro /usr/qt/3/mkspecs/linux-g++/qmake.conf
- $(QMAKE) -o Makefile src.pro
-qmake:
- @$(QMAKE) -o Makefile src.pro
-
-dist:
- @mkdir -p .tmp/planner && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/planner/ && ( cd `dirname .tmp/planner` && $(TAR) planner.tar planner && $(GZIP) planner.tar ) && $(MOVE) `dirname .tmp/planner`/planner.tar.gz . && $(DEL_FILE) -r .tmp/planner
-
-mocclean:
-uiclean:
-
-yaccclean:
-lexclean:
-clean:
- -$(DEL_FILE) $(OBJECTS)
- -$(DEL_FILE) *~ core *.core
-
-
-####### Sub-libraries
-
-distclean: clean
- -$(DEL_FILE) $(TARGET) $(TARGET)
-
-
-FORCE:
-
-####### Compile
-
-action.o: action.cpp action.h
-
-main.o: main.cpp planner.h \
- action.h
-
-node.o: node.cpp node.h \
- action.h
-
-planner.o: planner.cpp planner.h \
- node.h \
- action.h
-
-####### Install
-
-install:
-
-uninstall:
-
#include <vector>
#include "action.h"
+ #include "planner.h"
using namespace std;
cout << "id: " << *$1 << endl;
// Precondition flags:
- cout << "a: " << (*$2)["a"] << endl;
+ cout << "a: " << (*$2)["NET"] << endl;
cout << "b: " << (*$2)["b"] << endl;
cout << "c: " << (*$2)["c"] << endl;
cout << "d: " << (*$2)["d"] << endl;
cout << "exe: " << *$4 << endl;
// Print number of effects
- cout << "1: " << (*$5)[1].size() << endl;
+ cout << "1: " << (*$5)[0].size() << endl;
cout << "99: " << (*$5)[99].size() << endl;
cout << "88: " << (*$5)[88].size() << endl;
cerr << "Parse error : " << s;
}
+vector<string> stringToVector(string str){
+ vector<string> strings;
+
+ istringstream ist(str);
+ while (ist >> str){
+ strings.push_back(str);
+ }
+
+ return strings;
+}
int
main (int argc, char** argv)
actions = new vector<Action>();
yyparse();
+
+ Planner p(*actions, stringToVector(argv[2]), stringToVector(argv[3]));
+ p.execute();
}