设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15517|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 _: u* N5 a8 o4 X9 a2 U
. R$ y3 p8 v' t" Y6 p, J& T我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 ?) w6 \! G* p( w
* t% Z2 Y3 k+ I1 z% @- r
begin P_read arriving6 p) H1 T( M* K! V
    while 1=1 do begin1 E+ C1 d8 M0 D, W
        read A_tote from "data.txt" with delimiter "\n"
8 p) h; w. J) `( r2 e0 p        read A_time from "data.txt" with delimiter "\n"# G1 k) `' F. q5 E  a
        read A_leave from "data.txt" with delimiter "\n"8 m/ _. \5 V1 _, P
        read A_picks from "data.txt" with delimiter "\n"
& `$ I' v9 b1 _+ |6 ]6 T( X        set load type to A_tote# ^& Q* ]$ A5 g7 q, _8 ~; L
        if A_tote="tote 1" then set A_induct to 12 v! O. r: H  w, M0 ]- Y' g3 W9 Y
        else if A_tote="tote 2" then set A_induct to 2
1 P* B7 }! ?" q            else set A_induct to 3   
( Q0 \7 B5 I. o+ C        set A_i to 0/ Y& Y3 N8 l5 O  D6 C) W, l
        clone 1 load to P_induction
8 z6 _* h  e# G5 N$ [        wait for A_time sec1 o/ C# L! t( R
    end
# f+ o, I% K; lend2 ~( g7 i2 f( P0 J% I4 q

4 Z2 M! F3 i: ^begin P_induction arriving3 ]  U' w, O% Q# h- e$ l, Y  R
    if A_induct=1 then clone 1 load to P_pick1
6 I* u, X2 [& B7 X9 J: N    else if A_induct=2 then clone 1 load to P_pick2; l/ {1 J3 r# H- h, `  @
        else clone 1 load to P_pick3
4 [! L7 r8 d8 Z' g2 t( P6 F7 wend: M& a( e( l3 W% N6 T: B

. c5 e" {0 L% @0 S; K# H4 Gbegin P_pick1 arriving' |3 \6 \: }0 K$ P
    set A_i to 1
4 \4 t  i0 i/ z& Z" d    move into Q_induct1
9 k* D* U) Q$ J6 t9 [5 X    move into pickaisle.induct1
1 d3 k8 }( L1 q' z. e    while A_i<=30 do begin
) X& a! o% p+ o) {' i% r+ Z        travel to pickaisle.con(A_i)3 H. d: v/ E: `' A3 H! b3 K7 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. J9 J9 q) S# X$ `6 P) s) m
        else wait for 10 sec) S: a7 ^% J- ?+ Y
        if A_i=A_leave then send to die
! v( ~1 b" ]3 P        else inc A_i by 1
: L' `/ `1 ^8 m# u    end
, {7 Z8 }+ |4 j: I) a# Yend: a1 ~& J. |( b
1 k  X0 ]0 e. c- W1 t( i  N
begin P_pick2 arriving
" m" Q& n8 T) J. m1 X, v  n7 Q$ |    set A_i to 11. e/ `) Y* U  y% K
    move into Q_induct2
. Y: W5 T; N6 m* S" l8 O: _  s0 g9 }    move into pickaisle.induct2* f5 ?3 ~+ U# ~4 b8 \" V
    while A_i<=30 do begin/ y9 u# q7 W4 `' G  |0 F, u
        travel to pickaisle.con(A_i)
; t* s! V; q7 ^/ a% S0 ~; r+ b5 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  b# a& W$ y0 f        else wait for 10 sec+ G/ G' q; n. \( X) `6 d
        if A_i=A_leave then send to die
* a, W% ]9 I+ F% `! k, l5 [        else inc A_i by 1$ N/ [; y! [- G
    end
; G# T) }8 I; R8 w0 M' Eend
& e( {( r# s3 n% W+ P$ f6 T' m; [' F. `, I* a# O
begin P_pick3 arriving
8 T  C) i: k* r5 t4 ~% J    set A_i to 21
2 M$ F. T3 C  r6 s) l( E0 e2 D    move into Q_induct3
3 n+ _4 e2 K9 C# z    move into pickaisle.induct35 B" W; q; b7 v6 I3 n/ I- l6 C
    while A_i<=30 do begin
* C- M, d8 j- v& v        travel to pickaisle.con(A_i)2 N( S9 ~7 M& B+ t# u5 S* O2 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 u  y# h' P( a. S2 b5 O& M4 d4 k. S
        else wait for 10 sec6 |% i" T$ h7 L6 A% Z* n2 W& H9 ]; |' ?4 e
        if A_i=A_leave then send to die6 h7 i$ E% s( h$ z' U% @
        else inc A_i by 1  I8 C: v6 n5 c7 k) R  d! g
    end4 n. U  [- g# g5 V! d
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是个什么东东?0 ?2 `" h& R0 \/ u4 c# M# i
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ m; c) a/ {+ c7 B9 Z$ B( Y( R, }
5 o+ \1 V  V) SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 X& `) a, R# U8 Y* H
0 `$ b: Q" t* c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ y( @) V1 z" ]* l7 d1 o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, K. M( ~" A6 q. B9 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ ?! U9 H! q3 H8 r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! g9 R; z) B0 }' j6 ?' `: z& V
begin P_induction arriving
8 Y. M+ Y% v1 }" _    clone 1 load to P_pick(A_induct)+ u1 ?4 S# F" F5 ^% h& p
end最大的系
  C1 a; s+ q4 S& Q9 o: Z, |. K* I0 i) @3 K3 B3 H# Y" M. W
begin P_pick arriving
2 U1 {- i$ c, {5 B    set A_i to procindex * 10 + 19 ~& p7 o: ?5 f4 N2 n5 p
    move into Q_induct(procindex)
  E) l7 W  t8 H    move into pickaisle.induct(procindex)
0 p2 k. L$ _1 T4 g) k5 o7 T    /*check the type of pickaisle.induct(i), for your last problem.*/) u  u! q; w% v1 A' c1 T( @

4 r0 n8 }, G( L+ A1 n( Z0 V    while A_i<=30 do begin0 T3 k+ V. q: B9 e
        travel to pickaisle.con(A_i)
% b) @6 E0 k7 \) Z' a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ C! g* z2 I8 X
        else wait for 10 sec
. B9 K* J0 N' r9 h2 F" m3 f- E" H        if A_i=A_leave then send to die, ]# w7 }, ^, L" l
        else inc A_i by 1
- c# b  K3 @/ v9 h! `    end! e! Q8 n7 \) D& n* n
end! C. A2 {- U9 L. |% X
7 m, Q" o2 E+ n  m3 ?
其中的procindex为整形,代表当前process的序号。
, n( z: d! ]4 B$ g8 s* j4 I/ Nstation和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-9-17 00:39 , Processed in 0.018811 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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