设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12441|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: H3 n& k% d+ f- H
* q7 g7 D7 ?6 K0 z
我的问题是,在每个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 S8 f& E' U( t' O, v1 I: `2 m: Q" f9 J9 e. F0 g  R- I
begin P_read arriving
4 k: U2 |% y  h    while 1=1 do begin4 A/ k8 ~# p  Z1 O" x' t
        read A_tote from "data.txt" with delimiter "\n"
5 T, S, [$ E9 K# @        read A_time from "data.txt" with delimiter "\n"
8 |: w  U/ z: H; f        read A_leave from "data.txt" with delimiter "\n"
7 s: C* r# [* l6 J4 e; _# @        read A_picks from "data.txt" with delimiter "\n"1 S7 J% t3 i: o( z( K& A8 a
        set load type to A_tote( |8 D3 Z; ^+ c- U- u  W( V
        if A_tote="tote 1" then set A_induct to 14 G; o1 I& e% L& `, D4 [
        else if A_tote="tote 2" then set A_induct to 2- Q5 G+ G  F7 A- B' p
            else set A_induct to 3    / t% i% t+ i& X* L6 Q# K6 m
        set A_i to 0
& L: X" Y0 E/ c. g( R2 |        clone 1 load to P_induction  t* `; ]  c3 K! O0 F
        wait for A_time sec
4 |% |/ I/ f6 d5 A' _4 Z# j    end4 W$ t, \: @0 j. p8 }
end* f2 o: O! r2 g& |

3 e9 a  T& b& w1 u8 H3 @9 l# Hbegin P_induction arriving
. H& s3 l* _( k! Z8 G$ @    if A_induct=1 then clone 1 load to P_pick1
) w2 L# o; l& Z5 E    else if A_induct=2 then clone 1 load to P_pick2
$ K1 {  Y/ Y. y. A& Y        else clone 1 load to P_pick3
' O( Y8 _2 [" G4 n) }3 ~end7 f$ S% z! c  B* T( P0 O4 Z$ T6 e# {$ b

- V9 |8 y- ^$ Bbegin P_pick1 arriving$ m7 U, n, V5 ~' u6 ~+ Y
    set A_i to 17 R% H4 y! w% e! |, [: x, n/ w
    move into Q_induct1  V; @/ ~7 K6 n6 Z- H, d. Z) W
    move into pickaisle.induct1
+ v# z4 h: n9 F# i' ~- Z    while A_i<=30 do begin
/ D: D2 h% G% C: ^        travel to pickaisle.con(A_i)
. g" e  a# Y$ p% ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. J7 v% f8 w. v3 \: [: i        else wait for 10 sec/ ^# W. s/ s1 b) u9 V$ A9 V
        if A_i=A_leave then send to die
" V7 x! r9 e# B$ N        else inc A_i by 15 _- y2 d" c+ j0 w1 i8 S. w# i
    end( S; ]3 j4 ]8 Q( z! g- Q9 f; N
end
8 m% q( A4 ^! \- {1 i6 q
) O$ v8 L8 k) M' V4 |/ Vbegin P_pick2 arriving
  g1 j' {/ V) P3 @; K, l    set A_i to 11
7 _4 ?' j3 W; [8 w    move into Q_induct2
! d" ~) C6 B+ E/ Y/ E' s8 }    move into pickaisle.induct28 }+ N8 }3 g4 ]
    while A_i<=30 do begin" }1 p7 |2 Y; h& @0 F6 y9 w+ F/ W
        travel to pickaisle.con(A_i)
7 v6 B9 Y0 b5 W4 m' S/ `* N  t# y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 x$ s# y1 l2 T# H5 i/ K: `
        else wait for 10 sec5 z& R+ b( }+ Y0 h9 @% a5 O
        if A_i=A_leave then send to die
. @/ {9 b! v; H        else inc A_i by 1
9 j3 P. i. l/ f3 F& q% P  ]; ]2 \    end. {3 G+ q& v& ?- ~  [) Z1 [3 E
end
3 G% W2 e9 a$ M2 ?" i. W/ @
8 b  A1 J1 J, L! J- c) ^9 Hbegin P_pick3 arriving7 F2 a  E2 a4 G8 \
    set A_i to 213 p- M# b; {0 @9 y6 f. N
    move into Q_induct3' {  H0 q) h/ b( v
    move into pickaisle.induct3
, J' K% h/ o5 @+ U    while A_i<=30 do begin
/ L( Y4 r* ?$ x0 _) J9 v) U: Y        travel to pickaisle.con(A_i)
  v0 A* d6 J! p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 u% d7 t6 V1 U* F: S4 y        else wait for 10 sec
4 Q. Z  j) N8 X7 C% y        if A_i=A_leave then send to die
$ s2 g' Z: c3 h! F, b; P        else inc A_i by 1
$ X& W2 B9 I: ?3 I! a    end  U3 j  L1 B! G) l
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是个什么东东?" B- u( k6 o5 b, |9 L7 H, r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" D, e: o  j' b8 V1 `* i& c( d
1 A, b8 D7 r6 v+ v; ^" UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' b1 d% B- @/ N/ f6 P
$ o8 b( \& T2 H9 R# T( n! F0 R: @1 G8 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! V3 ]# {" d, t  m9 ^6 Z8 A) M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 }, W5 @* d+ P5 g) n4 K3 v
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ U5 O( C+ n- Q9 ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 ?2 `$ F& ?" W( r( y! S0 n
begin P_induction arriving2 l6 ~. G' L$ z2 Y# H
    clone 1 load to P_pick(A_induct)
/ u8 g  ~! p0 ]# n  cend最大的系  w! q# X1 Q/ ]9 z! Y' q
! f8 Y; a/ ]3 R+ n
begin P_pick arriving, V" o/ m8 Z( w
    set A_i to procindex * 10 + 1
, h& R- k) p% `. t    move into Q_induct(procindex)$ Y0 [' o8 @) g; B) a# i
    move into pickaisle.induct(procindex)
9 Y7 f" {: O" ^    /*check the type of pickaisle.induct(i), for your last problem.*/
6 i8 S  h: G" K  T! S. N) c  x. j7 Y
    while A_i<=30 do begin
4 e/ T/ X" s. K5 ^$ `$ k9 Z        travel to pickaisle.con(A_i)! }( ?( B/ m) O( y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! R  E0 S( h: x( w& y. H( H
        else wait for 10 sec
" f, L$ \1 G" ]! ^( A9 r: }        if A_i=A_leave then send to die
( g" A/ ?$ J" M5 C8 y        else inc A_i by 1
% g  p+ Y7 k7 {3 f& S    end# G; N- n& B7 [9 v
end
# l( S# H2 H5 Z: R  l( _5 W; D9 ?. ^" l2 W# v, `
其中的procindex为整形,代表当前process的序号。
3 {7 o. @5 m/ D3 Rstation和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-1-23 23:24 , Processed in 0.015632 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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