设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14327|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* Y4 j7 Q: P9 D- x7 L5 t
+ p7 |# L- g2 _0 }8 z# g$ \. `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" R$ e* W; j+ Z$ Q& L# h
! O/ h9 f  g5 L! u) }
begin P_read arriving0 d. P7 ~  Z1 a/ y
    while 1=1 do begin
- A" L3 w& K* F" W$ d, P# S* ]        read A_tote from "data.txt" with delimiter "\n"" X* d! F; ?) o4 E# y
        read A_time from "data.txt" with delimiter "\n"  E& ]+ m8 F* [' ?1 R. @# ?0 }
        read A_leave from "data.txt" with delimiter "\n"
) L4 U$ I# T1 g4 I        read A_picks from "data.txt" with delimiter "\n"
4 Q3 P2 V4 e( @8 _6 a  f6 G        set load type to A_tote  s8 R' J8 ]9 A
        if A_tote="tote 1" then set A_induct to 11 D! {; A+ p! v# a8 b* a
        else if A_tote="tote 2" then set A_induct to 2
1 w- I. p/ k: |/ U; {, d            else set A_induct to 3   
  |; q( q( l6 E7 Z9 I2 x        set A_i to 0
, n. v$ ?6 C% l: e% F4 E0 I        clone 1 load to P_induction' X$ j! p5 R6 o
        wait for A_time sec
! @7 K3 p; j% d2 c* Y, D* M    end2 H9 k# `  c% z4 {
end) K: j3 V" g* t( G$ H. @  m
9 c* k0 [, F" ?% K* B
begin P_induction arriving, B: b! k, }+ B8 Y$ w0 b
    if A_induct=1 then clone 1 load to P_pick1. n! m" f; h9 z4 ^) e2 s- [
    else if A_induct=2 then clone 1 load to P_pick2! P1 u: m2 @& a9 |6 v" _2 c& m% j5 Z
        else clone 1 load to P_pick32 R% e, F/ x7 D. X' [, O
end
# D) h* P8 ^1 T5 T: q3 H7 E4 p. {* G( B/ }" D8 Y2 f' n
begin P_pick1 arriving
0 z+ p/ @6 k$ f% Y; A7 Q0 g    set A_i to 1
7 u" f7 D. A% H9 [) g    move into Q_induct1
, `& m8 V% D2 A$ c    move into pickaisle.induct1. @  L1 T2 K* N, N3 h
    while A_i<=30 do begin
& p- t0 k3 F3 e        travel to pickaisle.con(A_i): d0 Q1 Y$ ^  Z/ w% [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 a* @; e" |' e* G  b
        else wait for 10 sec
/ C. z3 p5 d2 s        if A_i=A_leave then send to die
( N9 _% v0 g- Y. n        else inc A_i by 1
6 N. @& M4 i9 k  Z' }  [    end
3 l3 j# |5 a. A6 ^  ]end
/ c: Z# j% x, v/ o3 j" I# D+ p8 l; e5 i3 K
begin P_pick2 arriving6 `. E* ^# ~8 X/ }' y7 B
    set A_i to 11: `8 I( G! J8 o8 y- r: }
    move into Q_induct2
+ }, q+ ?. g7 u, p8 Z$ ~) D" |    move into pickaisle.induct2
. f/ W/ L4 t/ @, ~9 z$ R% n* D& \    while A_i<=30 do begin' \" E) u- \' t+ j: _6 @
        travel to pickaisle.con(A_i)% I1 V) R8 G. ]& L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- H/ ]2 p0 Y8 K6 T" C' Z
        else wait for 10 sec. y( Y* O# f4 t7 D. m3 t8 F
        if A_i=A_leave then send to die
- V' Z9 T* u, Y; k8 F        else inc A_i by 1
# O0 V+ K+ _" u# r% N" j    end
# x2 T' n6 Z6 L- L1 Wend. Q% K- T8 C$ c0 F2 R" V

6 ?- f+ \2 u3 y+ {, J9 z# H! kbegin P_pick3 arriving( p/ E- ~4 F" d1 f  y! X/ D' K
    set A_i to 21- C+ Q# h; l  l# w" k
    move into Q_induct3) ]6 ?" E$ S2 N/ N' u' E/ l
    move into pickaisle.induct3
6 K6 H8 M) [) x. h    while A_i<=30 do begin
, i) o7 E; I& [# p        travel to pickaisle.con(A_i)' `9 W8 u; ^" x" B7 N$ U) _3 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 b, ?9 b9 g" f5 `1 Z2 Z& |        else wait for 10 sec% r- i: l7 U9 M: }
        if A_i=A_leave then send to die
: |& }  s" o2 V: v' g0 a, Z' U        else inc A_i by 1
* K7 H* c! g8 |    end' l' Z: L) R8 G8 }& `
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是个什么东东?
8 W7 o% \' L9 P6 gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- K/ K" d2 E5 f1 g2 W, A+ I- i3 k1 U" t; W$ d8 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ n. D4 g, a3 @! Y4 i4 g2 S/ Z
- K* f* z$ X7 S% W% A9 o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ b4 E( r0 ?) u! Z- [7 ^7 d$ A0 e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 b4 |, ?: m" P% R, U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& ]" J4 _4 V% e# `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% x/ J" u' j$ N. H% f# `2 ~( e
begin P_induction arriving
* E6 d2 ^( I  _: w0 f5 d    clone 1 load to P_pick(A_induct)
  A7 r% U; c. {  t! W: {end最大的系2 `1 j. s' n4 t) ^0 s9 G  m6 g- h
; [2 N' c+ y/ ~; T
begin P_pick arriving8 |- |  d  U) i/ m
    set A_i to procindex * 10 + 1
. r4 s" e9 k% ~' ~6 ^7 l9 S, Y    move into Q_induct(procindex)
# J; M3 Q: u6 T2 L3 L' D    move into pickaisle.induct(procindex)
# ^9 [% }: a6 n) x# V- v    /*check the type of pickaisle.induct(i), for your last problem.*/
% n0 m6 T- ~0 ]  I. u8 K$ {
. f  k9 v- I7 u& S( V) O$ V- O2 b    while A_i<=30 do begin
8 V; F4 Q0 I$ F- [% R( Q        travel to pickaisle.con(A_i)# u! v9 l6 O1 `6 S& n. l8 ~& [6 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ P$ z; {# P- S2 P        else wait for 10 sec
9 Y, f9 F" z. @. H8 Y7 G        if A_i=A_leave then send to die
+ F! X8 z" `0 @        else inc A_i by 1
; _9 S) J! e. Q3 k- |% p1 n    end4 k% ^  i  S' b) l; [1 a6 @
end
2 D( n% m" ]$ u7 T" J* H+ O; u
! w& y" c6 F8 O- F' X" p其中的procindex为整形,代表当前process的序号。7 {! q# \4 J8 K9 X7 ?
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-7-3 05:13 , Processed in 0.023264 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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