设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15296|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- W! O2 @. [5 Z, n+ @* p; Q8 ]3 G+ H
1 E- n& _7 c& ~" C# W4 }& V/ B! x# x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 b8 R* O* C" s8 l+ }' @" o  g

6 Z+ O, ]! n' N' H: V9 `begin P_read arriving
2 u5 q7 Z$ Y3 a4 |2 F    while 1=1 do begin$ |1 h7 e$ V0 z) P" h, W2 V& E
        read A_tote from "data.txt" with delimiter "\n"2 q5 o1 u+ C3 e% M0 c
        read A_time from "data.txt" with delimiter "\n"3 d+ @9 E2 U# s! P+ e# q
        read A_leave from "data.txt" with delimiter "\n"! d0 j4 ?7 P9 k: p
        read A_picks from "data.txt" with delimiter "\n") r0 L# F! e* Z, N# ]6 a; t
        set load type to A_tote0 a/ a0 g: r" g" ^
        if A_tote="tote 1" then set A_induct to 1
: J% }/ @! Q/ I3 R- T7 Z  s0 c$ J        else if A_tote="tote 2" then set A_induct to 2
  u9 z7 W, ^" K9 h0 h            else set A_induct to 3   
3 R! z2 K( _8 y        set A_i to 0
% o0 r( ]7 H1 C4 ?1 P  z        clone 1 load to P_induction! [+ q3 v: @% d; {3 h/ I
        wait for A_time sec, P: d; H' ^  G7 W
    end
! X/ {, L+ O. {7 p; r6 B+ G% Cend
2 j3 W: c- t* e2 z+ [; ?3 B9 G
! Z5 `' f( x# a3 H/ s: A' \; e) hbegin P_induction arriving5 E3 E" x$ \4 S
    if A_induct=1 then clone 1 load to P_pick1
; z5 }& a- w0 E    else if A_induct=2 then clone 1 load to P_pick2" i6 |; J6 N2 d$ I& o8 ?3 T/ o# ?5 [
        else clone 1 load to P_pick3  [& d3 O# O4 s6 K/ b' @
end
" G# Y+ D6 V0 R' P) w7 m" s% _; S0 L
; w$ b! ?5 u5 c: [( Q/ Y4 Q6 _begin P_pick1 arriving
% P, \" B& d. s. @    set A_i to 18 f7 |) r2 U( h3 ]4 ?
    move into Q_induct1: O5 o$ Q0 d3 q( B( G
    move into pickaisle.induct1: l2 g+ l7 X' }+ S2 e
    while A_i<=30 do begin
7 y2 Q. V% I$ P% u, l% ?/ W        travel to pickaisle.con(A_i)
5 F/ L6 P) W8 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k, N# N9 Z& f% k# P7 K        else wait for 10 sec
3 c4 R0 b" a4 O2 |, Z5 i1 p        if A_i=A_leave then send to die
( {- d4 D& E( W        else inc A_i by 12 R8 I, c; {. M, n
    end
6 R; W/ l& {7 ~0 Iend: s0 v9 R% X# v- K, k) }, |
5 g5 X; `) P+ Z* ]5 [- p; W) H
begin P_pick2 arriving
, Y$ ?' w; N) ^  O' X/ R5 X    set A_i to 11
1 t. }) ]5 q7 M5 d  v    move into Q_induct2
9 w" D) w8 J  x# q    move into pickaisle.induct2) I) N9 _; j8 Y5 y. W) i
    while A_i<=30 do begin
! l& Y1 e3 r, |( Y1 ~* v        travel to pickaisle.con(A_i)/ n0 j- B4 ], g0 Y" }8 U6 ^& T* z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s6 M& r! ~9 ^; m) X; @- P/ R- t        else wait for 10 sec+ l1 q; m5 H, g
        if A_i=A_leave then send to die
% l- f7 |3 c! `6 Q5 `7 t9 y        else inc A_i by 1
7 N( d% f* r! P: n    end
: r. {6 U1 N* `% xend4 ~7 b+ f4 u; w) T
) [/ W8 v/ E, X3 q- g
begin P_pick3 arriving$ v& ?6 L/ m  V5 W3 z
    set A_i to 21
0 P5 _, |6 _0 }( ^# x( J6 M    move into Q_induct3' w4 c$ A% s" w
    move into pickaisle.induct3
: [2 Z0 [9 j6 P; O3 _    while A_i<=30 do begin
9 }9 O7 N' Z  k( l: M/ i! u, l! W        travel to pickaisle.con(A_i)+ M' e) h* k% t# J$ Q: w7 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ C+ J( p/ C5 y3 Y        else wait for 10 sec
$ z6 u3 T4 V/ l* E! ]- E        if A_i=A_leave then send to die
8 e! L# _4 \. H% s% t        else inc A_i by 1
/ U# m7 s% N# B; q    end
% [1 e5 C/ b" _) Y5 Yend

最佳答案

查看完整内容

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是个什么东东?
2 R% k# U* f; P, z! g  Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, Z3 L" d6 s( C* Z8 A, m( ]3 K; m* b+ b4 a( F8 f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 w& o4 P' T) i* D2 R' k; e0 L
2 {; Y* I# ^+ s$ C( Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 _/ o0 R1 s) B* m/ x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) A1 H3 n' K9 y# y6 @4 }2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 }8 a5 t5 k9 [$ K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  c- A4 b- c' m1 [, rbegin P_induction arriving
3 ?, I* u- I* d    clone 1 load to P_pick(A_induct)
( f6 y6 d: l/ o1 b) T6 }$ Gend最大的系' ~# M5 m/ L& l) g: G( N6 A( r( p

& N5 m' k# L( [( n. B& Abegin P_pick arriving
" q2 y4 c- y8 L' _# {. n    set A_i to procindex * 10 + 1
+ \+ N' j6 V4 J; p    move into Q_induct(procindex)' }, {' R- Z2 C$ J( ], y; `
    move into pickaisle.induct(procindex)
. z+ Y% E5 l/ x0 T1 v7 n, f) ?    /*check the type of pickaisle.induct(i), for your last problem.*/
/ V0 T2 w; \; c) b$ i. x9 H7 B. V2 I: N# |0 @. r5 |. h
    while A_i<=30 do begin" R& n% U3 [  e7 p+ z
        travel to pickaisle.con(A_i)/ p7 i0 n( a9 C/ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 n: n4 K2 |2 N
        else wait for 10 sec9 \; h# D! z% j9 t6 @
        if A_i=A_leave then send to die, X6 X; q7 A! h  I: L, A) N
        else inc A_i by 1
5 U1 R9 g; L* T: Q    end
+ g5 @; H! ~$ H' l8 t; iend
" J  I, _6 F) m. r5 |* M$ l" G$ @- [  t' g2 p1 Y- R
其中的procindex为整形,代表当前process的序号。, Q$ h# C6 |2 C: `7 K
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-8-31 12:31 , Processed in 0.017242 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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