设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12850|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 r8 S8 f3 v8 M8 h7 f5 l) B! S( `5 B+ {- Z! L) s4 W2 L& }+ m
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。" y; p& H$ g6 N
' e8 o; T+ `0 W. c# }, m1 e
begin P_read arriving
8 L6 C  R& k- L    while 1=1 do begin
; a9 T0 O# O. w- V# a# `" N        read A_tote from "data.txt" with delimiter "\n"1 y) S+ a( g* T# P4 ^
        read A_time from "data.txt" with delimiter "\n"
3 |. _% i& _' ~; p9 r8 d( r        read A_leave from "data.txt" with delimiter "\n"
, W" e- \! `+ H& @+ C        read A_picks from "data.txt" with delimiter "\n"& S* e8 r- c$ q. v& j
        set load type to A_tote& j: B! J7 m; t3 ?) x- F: U0 o
        if A_tote="tote 1" then set A_induct to 1, j& F) I% u% b
        else if A_tote="tote 2" then set A_induct to 29 ]: Y/ R, \# }' `/ m6 x
            else set A_induct to 3   
! }! u: _" C3 {6 L( X        set A_i to 0
# ?3 m+ f' [7 Q        clone 1 load to P_induction
6 o% j# I4 A& Q/ G7 j9 D        wait for A_time sec
% i, x) k$ k7 V* d  f& h    end
0 N5 L: H* ~0 qend( H6 Y$ h. J2 K( E. s

# {3 F8 P) g, }* `: ~begin P_induction arriving4 E6 J  e" X% }
    if A_induct=1 then clone 1 load to P_pick17 M9 w( N0 O3 m5 [
    else if A_induct=2 then clone 1 load to P_pick2
4 l) g; }* {% E        else clone 1 load to P_pick3
- N/ _# a& Z5 }' f3 b/ Dend/ ?4 S' r2 V# Y; {/ i
) N0 J2 J' L- G
begin P_pick1 arriving
/ l6 M; v2 N0 D3 U+ W    set A_i to 1
4 i$ Y) @/ X3 X* J  e+ h6 u    move into Q_induct1$ b$ ^7 l2 u9 x
    move into pickaisle.induct1
* j) F: y  E6 ~7 m6 z    while A_i<=30 do begin
2 `+ C! n4 R! B        travel to pickaisle.con(A_i)- Y4 P  t5 z8 v- o# C3 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 I- p2 p# ^2 H! z2 @) U
        else wait for 10 sec
1 ~/ m% n/ k9 a# w' o        if A_i=A_leave then send to die
8 Q' G5 b8 x& g, ]        else inc A_i by 1- K9 r" `! s/ r. L8 _
    end& M, f" w/ \2 V: q/ |$ ^& m
end
. Z8 \9 T# R2 O; O4 X4 {/ n
8 e3 k  @  W7 ^- W, [begin P_pick2 arriving
' U5 u: h4 Z/ u, k2 g. Y    set A_i to 11
/ ]$ H4 b6 n$ O2 k% F% e  J2 R. e    move into Q_induct2% T! Q! [& K: T% N+ S- `
    move into pickaisle.induct2
* @/ C$ T  B& Y9 P    while A_i<=30 do begin
" f3 a$ D, R6 n5 S        travel to pickaisle.con(A_i)
. |# G% I3 K2 F1 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 |3 o" X, j9 {' H: i) T" F$ q7 U
        else wait for 10 sec9 v! e; e3 k: s$ ]6 f
        if A_i=A_leave then send to die  |1 \) F4 e. {5 ~( z; R) ]
        else inc A_i by 1: ?# n4 B# m: T) v$ _, F, _
    end
9 K' P; P- [8 x. M5 M' Send
( q  h# S2 H4 e" \, g! r$ E; \
begin P_pick3 arriving2 {9 j8 L1 c; g! M
    set A_i to 21* G2 N: \' H; p5 \: V  i" s! l
    move into Q_induct3. V, ?" A4 c: }- [. r& `
    move into pickaisle.induct34 [/ n  \  E2 k
    while A_i<=30 do begin
  d) m  h8 s+ X+ @        travel to pickaisle.con(A_i)7 N) Z9 g+ w* r& i& ]3 b1 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ x) F4 s8 M5 ]        else wait for 10 sec
: s( M- c" I% D9 S5 M        if A_i=A_leave then send to die
; ^. S: [' l( ]  H        else inc A_i by 1& p6 _3 O* A: h$ h" e
    end( A3 e" V# `! ?9 B- f  q2 S& ]
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?/ f  F7 e1 Z- \8 T& ~  B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( ~2 g  g# {4 H# w

7 M" z- O4 d( i- @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 U0 `" i9 S) ~# x% N( V% m9 `
- v/ W; q, F& a2 i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 o+ U& M: A8 p1 t  l9 u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. ?5 V/ c+ a4 x  ~0 t% v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' T. L4 u5 J: l+ F$ {, y: D7 C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 y% o$ d4 ?. _$ Q5 O  i" Gbegin P_induction arriving1 T1 [8 P) m1 K  P2 a9 l2 B
    clone 1 load to P_pick(A_induct)
% N5 M! G# s. x; I) ?, O( gend最大的系
- m% A* Q' S" x* A9 e) Y8 ^
; T0 F1 Y' @, y% l5 Kbegin P_pick arriving) O) Z. w' l% |& w& `4 ?4 e; L
    set A_i to procindex * 10 + 14 }% O( X5 F/ B" F: E( y
    move into Q_induct(procindex)
* B' B( ~1 y# F. W2 E$ d0 j    move into pickaisle.induct(procindex)% U( W1 s  L: y( p. M7 j5 i
    /*check the type of pickaisle.induct(i), for your last problem.*/- `- w4 Z# S4 j; ~

; x' J" @! U0 O* V% ^& ?    while A_i<=30 do begin
$ Y: e- @. z4 s$ L" R$ n3 C4 D        travel to pickaisle.con(A_i): Z7 \% H2 Y8 r& L) U: H- F9 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! w$ t6 T. j) l7 O# P3 |7 A+ S. E. w
        else wait for 10 sec
, p8 b% `+ q( ^9 A; c. C        if A_i=A_leave then send to die5 m% d* G- d+ s1 Z% p1 D
        else inc A_i by 1/ |% G( ~  E' ?5 |+ J7 N" y  }
    end2 s& {$ f# Z% \0 u" U9 }: a
end
" [: a, c. h3 w5 v7 n
: Y+ l) o' H/ f! b其中的procindex为整形,代表当前process的序号。% Y- u; C9 A: z
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-2-24 13:53 , Processed in 0.017369 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表